diff options
Diffstat (limited to 'spec/workers/pipeline_hooks_worker_spec.rb')
-rw-r--r-- | spec/workers/pipeline_hooks_worker_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/workers/pipeline_hooks_worker_spec.rb b/spec/workers/pipeline_hooks_worker_spec.rb index 13a86c3d4fe..5d28b1e129a 100644 --- a/spec/workers/pipeline_hooks_worker_spec.rb +++ b/spec/workers/pipeline_hooks_worker_spec.rb @@ -25,6 +25,16 @@ RSpec.describe PipelineHooksWorker do .not_to raise_error end end + + context 'when the user is blocked' do + let(:pipeline) { create(:ci_pipeline, user: create(:user, :blocked)) } + + it 'returns early without executing' do + expect(Ci::Pipelines::HookService).not_to receive(:new) + + described_class.new.perform(pipeline.id) + end + end end it_behaves_like 'worker with data consistency', |