Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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 1be50083cd4..4951f57fe6f 100644
--- a/spec/models/ci/stage_spec.rb
+++ b/spec/models/ci/stage_spec.rb
@@ -166,6 +166,18 @@ RSpec.describe Ci::Stage, :models, feature_category: :continuous_integration do
end
end
+ context 'when build is waiting for callback' do
+ before do
+ create(:ci_build, :waiting_for_callback, stage_id: stage.id)
+ end
+
+ it 'updates status to waiting for callback' do
+ expect { stage.update_legacy_status }
+ .to change { stage.reload.status }
+ .to 'waiting_for_callback'
+ end
+ end
+
context 'when stage is skipped because is empty' do
it 'updates status to skipped' do
expect { stage.update_legacy_status }