summaryrefslogtreecommitdiff
path: root/spec/models/ci/stage_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/ci/stage_spec.rb')
-rw-r--r--spec/models/ci/stage_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/ci/stage_spec.rb b/spec/models/ci/stage_spec.rb
index b65c11f837c..7e2751128e2 100644
--- a/spec/models/ci/stage_spec.rb
+++ b/spec/models/ci/stage_spec.rb
@@ -105,6 +105,18 @@ describe Ci::Stage, :models do
end
end
+ context 'when build is waiting for resource' do
+ before do
+ create(:ci_build, :waiting_for_resource, stage_id: stage.id)
+ end
+
+ it 'updates status to waiting for resource' do
+ expect { stage.update_status }
+ .to change { stage.reload.status }
+ .to 'waiting_for_resource'
+ end
+ end
+
context 'when stage is skipped because is empty' do
it 'updates status to skipped' do
expect { stage.update_status }