diff options
author | Rémy Coutable <remy@rymai.me> | 2016-06-07 13:01:34 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-06-10 14:36:57 +0200 |
commit | 6dff7c1771e0cfeb6906244649b3683090bc2929 (patch) | |
tree | acff551905a3371e709b3e453c0b6bd6cfa6808d /spec/requests/api/merge_requests_spec.rb | |
parent | 07dbd6b3884c4f188b2c3f29dd7419791f1051eb (diff) | |
download | gitlab-ce-6dff7c1771e0cfeb6906244649b3683090bc2929.tar.gz |
Improve initial implementation of the 'only_allow_merge_if_build_succeeds.rb' feature
Based on the feedback from reviewers.
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/requests/api/merge_requests_spec.rb')
-rw-r--r-- | spec/requests/api/merge_requests_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb index 91c25a0948f..a52148e8b83 100644 --- a/spec/requests/api/merge_requests_spec.rb +++ b/spec/requests/api/merge_requests_spec.rb @@ -419,10 +419,11 @@ describe API::API, api: true do expect(json_response['message']).to eq('405 Method Not Allowed') end - it "should return 405 if merge_request build is failed it's restrict to merge only when susccess" do - allow_any_instance_of(MergeRequest).to receive(:cannot_be_merged_because_build_failed?).and_return(true) + it 'returns 405 if the build failed for a merge request that requires success' do + allow_any_instance_of(MergeRequest).to receive(:cannot_be_merged_because_build_is_not_success?).and_return(true) put api("/projects/#{project.id}/merge_requests/#{merge_request.id}/merge", user) + expect(response.status).to eq(405) expect(json_response['message']).to eq('405 Method Not Allowed') end |