diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 21:09:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 21:09:21 +0300 |
commit | e0fa0638a422c3e20d4423c9bb69d79afc9c7d3d (patch) | |
tree | 9abb3c0706576bbda895fe9539a55556930606e2 /spec/workers/pipeline_notification_worker_spec.rb | |
parent | f8d15ca65390475e356b06dedc51e10ccd179f86 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/pipeline_notification_worker_spec.rb')
-rw-r--r-- | spec/workers/pipeline_notification_worker_spec.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/workers/pipeline_notification_worker_spec.rb b/spec/workers/pipeline_notification_worker_spec.rb index 98b0f139fe2..5defd3d5bd7 100644 --- a/spec/workers/pipeline_notification_worker_spec.rb +++ b/spec/workers/pipeline_notification_worker_spec.rb @@ -3,13 +3,16 @@ require 'spec_helper' describe PipelineNotificationWorker, :mailer do - let(:pipeline) { create(:ci_pipeline) } + let_it_be(:pipeline) { create(:ci_pipeline) } describe '#execute' do it 'calls NotificationService#pipeline_finished when the pipeline exists' do - expect(NotificationService).to receive_message_chain(:new, :pipeline_finished) + notification_service_double = double + expect(notification_service_double).to receive(:pipeline_finished) + .with(pipeline, ref_status: 'success', recipients: ['test@gitlab.com']) + expect(NotificationService).to receive(:new).and_return(notification_service_double) - subject.perform(pipeline.id) + subject.perform(pipeline.id, ref_status: 'success', recipients: ['test@gitlab.com']) end it 'does nothing when the pipeline does not exist' do |