diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2018-10-19 10:16:58 +0300 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2018-11-14 17:16:19 +0300 |
commit | 6b0ea951cac3905437abb2bbacaf422371f097e0 (patch) | |
tree | 55b61f7c3a5a4447fb70733780fca614ac1a73ef /spec/services/merge_requests/create_from_issue_service_spec.rb | |
parent | f5e3ce5ed612c9b247e362ed7c667557331e5bfd (diff) |
Creates /create_merge_request quickaction
With this quick action the user can create a new MR starting from
the current issue using as `source_branch` the given `branch name` and
as `target_branch` the project default branch. If the `branch name` is
omitted a name is automatically created starting from the issue title.
Diffstat (limited to 'spec/services/merge_requests/create_from_issue_service_spec.rb')
-rw-r--r-- | spec/services/merge_requests/create_from_issue_service_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/services/merge_requests/create_from_issue_service_spec.rb b/spec/services/merge_requests/create_from_issue_service_spec.rb index b1882df732d..393299cce00 100644 --- a/spec/services/merge_requests/create_from_issue_service_spec.rb +++ b/spec/services/merge_requests/create_from_issue_service_spec.rb @@ -61,7 +61,15 @@ describe MergeRequests::CreateFromIssueService do expect(project.repository.branch_exists?(custom_source_branch)).to be_truthy end - it 'creates a system note' do + it 'creates the new_merge_request system note' do + expect(SystemNoteService).to receive(:new_merge_request).with(issue, project, user, instance_of(MergeRequest)) + + service.execute + end + + it 'creates the new_issue_branch system note when the branch could be created but the merge_request cannot be created' do + project.project_feature.update!(merge_requests_access_level: ProjectFeature::DISABLED) + expect(SystemNoteService).to receive(:new_issue_branch).with(issue, project, user, issue.to_branch_name) service.execute |