diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-31 12:07:05 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-31 12:07:05 +0200 |
commit | cec2cc3ffa3077346c81625f6b1f48c113e19e93 (patch) | |
tree | 3244466f998e95e38c2e5edb45fb6e881a20ccc4 | |
parent | 8f1274ae0350590a8a0d8f16558d24a9514b78c1 (diff) | |
download | gitlab-ce-cec2cc3ffa3077346c81625f6b1f48c113e19e93.tar.gz |
Add specs for stage update worker
-rw-r--r-- | spec/workers/stage_update_worker_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/workers/stage_update_worker_spec.rb b/spec/workers/stage_update_worker_spec.rb new file mode 100644 index 00000000000..7bc76c79464 --- /dev/null +++ b/spec/workers/stage_update_worker_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe StageUpdateWorker do + describe '#perform' do + context 'when stage exists' do + let(:stage) { create(:ci_stage_entity) } + + it 'updates stage status' do + expect_any_instance_of(Ci::Stage).to receive(:update_status) + + described_class.new.perform(stage.id) + end + end + + context 'when stage does not exist' do + it 'does not raise exception' do + expect { described_class.new.perform(123) } + .not_to raise_error + end + end + end +end |