diff options
author | Nick Thomas <nick@gitlab.com> | 2018-10-12 18:06:56 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-12-07 15:31:36 +0300 |
commit | 4d801a70fb7a2474e988334b059df3bcc72c2ae6 (patch) | |
tree | 0091faf91e4ce44fdf2d4dd867b465d741764733 /spec/controllers | |
parent | b96dbc67b742e9602d8741b2f01ffe8fe6f92622 (diff) |
Inline the new checks into normal update error handling
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/merge_requests_controller_spec.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb index f64bda7154b..7f15da859e5 100644 --- a/spec/controllers/projects/merge_requests_controller_spec.rb +++ b/spec/controllers/projects/merge_requests_controller_spec.rb @@ -291,14 +291,16 @@ describe Projects::MergeRequestsController do it_behaves_like 'update invalid issuable', MergeRequest end - context 'there are two merge requests with the same source branch' do - it "does not allow to reopen a closed merge request if another one is open" do + 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') - expect(controller).to set_flash[:alert].to(/Another open Merge Request already exists for this source branch/) + 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 |