diff options
Diffstat (limited to 'spec/workers/pipeline_notification_worker_spec.rb')
-rw-r--r-- | spec/workers/pipeline_notification_worker_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/workers/pipeline_notification_worker_spec.rb b/spec/workers/pipeline_notification_worker_spec.rb index 583c4bf1c0c..672debd0501 100644 --- a/spec/workers/pipeline_notification_worker_spec.rb +++ b/spec/workers/pipeline_notification_worker_spec.rb @@ -21,6 +21,20 @@ RSpec.describe PipelineNotificationWorker, :mailer do subject.perform(non_existing_record_id) end + context 'when the user is blocked' do + before do + expect_next_found_instance_of(Ci::Pipeline) do |pipeline| + allow(pipeline).to receive(:user) { build(:user, :blocked) } + end + end + + it 'does nothing' do + expect(NotificationService).not_to receive(:new) + + subject.perform(pipeline.id) + end + end + it_behaves_like 'worker with data consistency', described_class, data_consistency: :delayed |