diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/services/merge_requests | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/services/merge_requests')
-rw-r--r-- | spec/services/merge_requests/after_create_service_spec.rb | 19 | ||||
-rw-r--r-- | spec/services/merge_requests/base_service_spec.rb | 3 |
2 files changed, 16 insertions, 6 deletions
diff --git a/spec/services/merge_requests/after_create_service_spec.rb b/spec/services/merge_requests/after_create_service_spec.rb index 840b7bc0a1c..69bab3b1ea4 100644 --- a/spec/services/merge_requests/after_create_service_spec.rb +++ b/spec/services/merge_requests/after_create_service_spec.rb @@ -18,32 +18,34 @@ RSpec.describe MergeRequests::AfterCreateService do allow(after_create_service).to receive(:notification_service).and_return(notification_service) end + subject(:execute_service) { after_create_service.execute(merge_request) } + it 'creates a merge request open event' do expect(event_service) .to receive(:open_mr).with(merge_request, merge_request.author) - after_create_service.execute(merge_request) + execute_service end it 'creates a new merge request notification' do expect(notification_service) .to receive(:new_merge_request).with(merge_request, merge_request.author) - after_create_service.execute(merge_request) + execute_service end it 'writes diffs to the cache' do expect(merge_request) .to receive_message_chain(:diffs, :write_cache) - after_create_service.execute(merge_request) + execute_service end it 'creates cross references' do expect(merge_request) .to receive(:create_cross_references!).with(merge_request.author) - after_create_service.execute(merge_request) + execute_service end it 'creates a pipeline and updates the HEAD pipeline' do @@ -51,7 +53,14 @@ RSpec.describe MergeRequests::AfterCreateService do .to receive(:create_pipeline_for).with(merge_request, merge_request.author) expect(merge_request).to receive(:update_head_pipeline) - after_create_service.execute(merge_request) + execute_service + end + + it 'records a namespace onboarding progress action' do + expect(NamespaceOnboardingAction).to receive(:create_action) + .with(merge_request.target_project.namespace, :merge_request_created).and_call_original + + expect { execute_service }.to change(NamespaceOnboardingAction, :count).by(1) end end end diff --git a/spec/services/merge_requests/base_service_spec.rb b/spec/services/merge_requests/base_service_spec.rb index bb7b70f1ba2..83431105545 100644 --- a/spec/services/merge_requests/base_service_spec.rb +++ b/spec/services/merge_requests/base_service_spec.rb @@ -20,7 +20,8 @@ RSpec.describe MergeRequests::BaseService do describe '#execute_hooks' do shared_examples 'enqueues Jira sync worker' do - it do + specify :aggregate_failures do + expect(JiraConnect::SyncMergeRequestWorker).to receive(:perform_async).with(kind_of(Numeric), kind_of(Numeric)).and_call_original Sidekiq::Testing.fake! do expect { subject.execute }.to change(JiraConnect::SyncMergeRequestWorker.jobs, :size).by(1) end |