diff options
Diffstat (limited to 'spec/workers/run_pipeline_schedule_worker_spec.rb')
-rw-r--r-- | spec/workers/run_pipeline_schedule_worker_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/workers/run_pipeline_schedule_worker_spec.rb b/spec/workers/run_pipeline_schedule_worker_spec.rb index fc572c0d9c3..bb11d1dbb58 100644 --- a/spec/workers/run_pipeline_schedule_worker_spec.rb +++ b/spec/workers/run_pipeline_schedule_worker_spec.rb @@ -68,5 +68,20 @@ RSpec.describe RunPipelineScheduleWorker do worker.perform(pipeline_schedule.id, user.id) end end + + context 'when pipeline cannot be created' do + before do + allow(Ci::CreatePipelineService).to receive(:new) { raise Ci::CreatePipelineService::CreateError } + end + + it 'logging a pipeline error' do + expect(worker) + .to receive(:log_extra_metadata_on_done) + .with(:pipeline_creation_error, an_instance_of(Ci::CreatePipelineService::CreateError)) + .and_call_original + + worker.perform(pipeline_schedule.id, user.id) + end + end end end |