diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 18:08:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 18:08:26 +0300 |
commit | c859c3bfd242288065fe5e2d887f7204f09e2335 (patch) | |
tree | 10febaf8774a3ea6ab3773c0dd97658d673fb280 /spec/requests/api/merge_requests_spec.rb | |
parent | 28ce39a3e0e7b47e53939a15fb823af9c433327a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/merge_requests_spec.rb')
-rw-r--r-- | spec/requests/api/merge_requests_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb index ae0596bea98..c3d92a90d11 100644 --- a/spec/requests/api/merge_requests_spec.rb +++ b/spec/requests/api/merge_requests_spec.rb @@ -65,6 +65,21 @@ describe API::MergeRequests do end.not_to exceed_query_limit(control) end + context 'when merge request is unchecked' do + before do + merge_request.mark_as_unchecked! + end + + it 'checks mergeability asynchronously' do + expect_next_instance_of(MergeRequests::MergeabilityCheckService) do |service| + expect(service).not_to receive(:execute) + expect(service).to receive(:async_execute) + end + + get api(endpoint_path, user) + end + end + context 'with labels' do include_context 'with labels' @@ -1003,6 +1018,21 @@ describe API::MergeRequests do expect(json_response['user']['can_merge']).to be_falsy end + + context 'when merge request is unchecked' do + before do + merge_request.mark_as_unchecked! + end + + it 'checks mergeability asynchronously' do + expect_next_instance_of(MergeRequests::MergeabilityCheckService) do |service| + expect(service).not_to receive(:execute) + expect(service).to receive(:async_execute) + end + + get api("/projects/#{project.id}/merge_requests/#{merge_request.iid}", user) + end + end end describe 'GET /projects/:id/merge_requests/:merge_request_iid/participants' do |