diff options
author | Alex Hanselka <alex@gitlab.com> | 2018-12-11 00:42:50 +0300 |
---|---|---|
committer | Alex Hanselka <alex@gitlab.com> | 2018-12-11 00:42:50 +0300 |
commit | f77888fe0857c9f4a47133f434c741a510946767 (patch) | |
tree | b227b60894474ba2c9a8864b66e4df65763b35b8 /spec/controllers/projects/merge_requests_controller_spec.rb | |
parent | d2120ff1e705799752e7d9704cae3f1896d8e186 (diff) | |
parent | 2d7dc668506a0576e231fbe290c89e47cf088300 (diff) |
Merge branch '11-6-stable-prepare-rc5' into '11-6-stable'
Prepare 11.6 RC5 release
See merge request gitlab-org/gitlab-ce!23704
Diffstat (limited to 'spec/controllers/projects/merge_requests_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/merge_requests_controller_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb index e62523c65c9..7f15da859e5 100644 --- a/spec/controllers/projects/merge_requests_controller_spec.rb +++ b/spec/controllers/projects/merge_requests_controller_spec.rb @@ -290,6 +290,20 @@ describe Projects::MergeRequestsController do it_behaves_like 'update invalid issuable', MergeRequest end + + context 'two merge requests with the same source branch' do + it 'does not allow a closed merge request to be reopened if another one is open' do + merge_request.close! + create(:merge_request, source_project: merge_request.source_project, source_branch: merge_request.source_branch) + + update_merge_request(state_event: 'reopen') + + errors = assigns[:merge_request].errors + + expect(errors[:validate_branches]).to include(/Another open merge request already exists for this source branch/) + expect(merge_request.reload).to be_closed + end + end end describe 'POST merge' do |