diff options
author | Athar Hameed <athar@gitlab.com> | 2018-06-08 15:28:43 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-06-08 15:28:43 +0300 |
commit | c22e51e8c1372e844aa3c4447ebea371d77d0c89 (patch) | |
tree | 4538509a53d1b1108e953147230fc7fb54553481 /spec/services/merge_requests/create_from_issue_service_spec.rb | |
parent | f068479e637c52b839c3474a87c2d01e82ba0829 (diff) |
Resolve "Automatically created MR uses wrong target branch (when branching from Tag)"
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 | 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 |