diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-04 15:54:58 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-04 15:54:58 +0300 |
commit | 30988aecd9fe8223563d02942666683fb1bd29c0 (patch) | |
tree | 9192e34f0dd62759d4efc9bab604437c8b5ae84c /spec/requests | |
parent | c0f223deb28c121759842d42e1befe3b2eb11bb4 (diff) | |
parent | 1c8e99be48551b8b04791166886d2b2ac86d83d3 (diff) |
Merge branch 'ignore-merge-when-merge-pipelines-is-stale-ce' into 'master'
Backport: Ignore merge if the status of the merge request pipeline is stale
See merge request gitlab-org/gitlab-ce!26975
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/merge_requests_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb index 1d139200535..7ffa365c651 100644 --- a/spec/requests/api/merge_requests_spec.rb +++ b/spec/requests/api/merge_requests_spec.rb @@ -1361,7 +1361,12 @@ describe API::MergeRequests do end it 'returns 405 if the build failed for a merge request that requires success' do - allow_any_instance_of(MergeRequest).to receive(:mergeable_ci_state?).and_return(false) + project.update!(only_allow_merge_if_pipeline_succeeds: true) + + create(:ci_pipeline, + :failed, + sha: merge_request.diff_head_sha, + merge_requests_as_head_pipeline: [merge_request]) put api("/projects/#{project.id}/merge_requests/#{merge_request.iid}/merge", user) |