summaryrefslogtreecommitdiff
path: root/spec/workers/pipeline_update_worker_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/pipeline_update_worker_spec.rb')
-rw-r--r--spec/workers/pipeline_update_worker_spec.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/workers/pipeline_update_worker_spec.rb b/spec/workers/pipeline_update_worker_spec.rb
index 187298034cc..c5c1cc0eefd 100644
--- a/spec/workers/pipeline_update_worker_spec.rb
+++ b/spec/workers/pipeline_update_worker_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe PipelineUpdateWorker do
+RSpec.describe PipelineUpdateWorker do
describe '#perform' do
context 'when pipeline exists' do
let(:pipeline) { create(:ci_pipeline) }
@@ -12,6 +12,14 @@ describe PipelineUpdateWorker do
described_class.new.perform(pipeline.id)
end
+
+ include_examples 'an idempotent worker' do
+ let(:job_args) { [pipeline.id] }
+
+ it 'sets pipeline status to skipped' do
+ expect { subject }.to change { pipeline.reload.status }.from('pending').to('skipped')
+ end
+ end
end
context 'when pipeline does not exist' do