diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-06-08 15:28:43 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-06-08 15:28:43 +0300 |
commit | e1f9f3c6ac8a71c8196c8eae7d4c573899466cdf (patch) | |
tree | 4538509a53d1b1108e953147230fc7fb54553481 /spec | |
parent | f068479e637c52b839c3474a87c2d01e82ba0829 (diff) | |
parent | c22e51e8c1372e844aa3c4447ebea371d77d0c89 (diff) |
Merge branch '45400-automatically-created-mr-uses-wrong-target-branch-when-branching-from-tag' into 'master'
Resolve "Automatically created MR uses wrong target branch (when branching from Tag)"
Closes #45400
See merge request gitlab-org/gitlab-ce!19067
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/merge_requests/create_from_issue_service_spec.rb | 11 |
1 files changed, 8 insertions, 3 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 38d84cf0ceb..b1882df732d 100644 --- a/spec/services/merge_requests/create_from_issue_service_spec.rb +++ b/spec/services/merge_requests/create_from_issue_service_spec.rb @@ -125,9 +125,14 @@ describe MergeRequests::CreateFromIssueService do end context 'when ref branch does not exist' do - it 'does not create a merge request' do - expect { described_class.new(project, user, issue_iid: issue.iid, ref: 'nobr').execute } - .not_to change { project.merge_requests.count } + subject { described_class.new(project, user, issue_iid: issue.iid, ref: 'no-such-branch').execute } + + it 'creates a merge request' do + expect { subject }.to change(project.merge_requests, :count).by(1) + end + + it 'sets the merge request target branch to the project default branch' do + expect(subject[:merge_request].target_branch).to eq(project.default_branch) end end end |