diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /spec/services/merge_requests/mergeability_check_service_spec.rb | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'spec/services/merge_requests/mergeability_check_service_spec.rb')
-rw-r--r-- | spec/services/merge_requests/mergeability_check_service_spec.rb | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/spec/services/merge_requests/mergeability_check_service_spec.rb b/spec/services/merge_requests/mergeability_check_service_spec.rb index 65599b7e046..c24b83e21a6 100644 --- a/spec/services/merge_requests/mergeability_check_service_spec.rb +++ b/spec/services/merge_requests/mergeability_check_service_spec.rb @@ -73,12 +73,10 @@ RSpec.describe MergeRequests::MergeabilityCheckService, :clean_gitlab_redis_shar let(:merge_request) { create(:merge_request, merge_status: :unchecked, source_project: project, target_project: project) } describe '#async_execute' do - shared_examples_for 'no job is enqueued' do - it 'does not enqueue MergeRequestMergeabilityCheckWorker' do - expect(MergeRequestMergeabilityCheckWorker).not_to receive(:perform_async) + it 'updates merge status to checking' do + described_class.new(merge_request).async_execute - described_class.new(merge_request).async_execute - end + expect(merge_request).to be_checking end it 'enqueues MergeRequestMergeabilityCheckWorker' do @@ -92,15 +90,11 @@ RSpec.describe MergeRequests::MergeabilityCheckService, :clean_gitlab_redis_shar allow(Gitlab::Database).to receive(:read_only?) { true } end - it_behaves_like 'no job is enqueued' - end + it 'does not enqueue MergeRequestMergeabilityCheckWorker' do + expect(MergeRequestMergeabilityCheckWorker).not_to receive(:perform_async) - context 'when merge_status is already checking' do - before do - merge_request.mark_as_checking + described_class.new(merge_request).async_execute end - - it_behaves_like 'no job is enqueued' end end |