summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-08-25 09:54:42 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2017-08-25 09:54:42 +0000
commit04c092b58d2fe68da10b6291955fd5fd50ac1877 (patch)
tree1906223384a6b94eb97a670066ea7b6a028db0c9 /spec/models
parentec784b1e5195848e55185831ee024a756f18a9f0 (diff)
parent37881ebb75be2069f49f6faf6e01ca73223e998f (diff)
downloadgitlab-ce-04c092b58d2fe68da10b6291955fd5fd50ac1877.tar.gz
Merge branch 'fix/gb/fix-invalid-stage-status-transition' into 'master'
Set a default CI/CD status when it is not known Closes #36790 See merge request !13737
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/ci/stage_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/ci/stage_spec.rb b/spec/models/ci/stage_spec.rb
index 74c9d6145e2..586d073eb5e 100644
--- a/spec/models/ci/stage_spec.rb
+++ b/spec/models/ci/stage_spec.rb
@@ -38,6 +38,17 @@ describe Ci::Stage, :models do
expect(stage.status).to eq 'success'
end
end
+
+ context 'when stage status is not defined' do
+ before do
+ stage.update_column(:status, nil)
+ end
+
+ it 'sets the default value' do
+ expect(described_class.find(stage.id).status)
+ .to eq 'created'
+ end
+ end
end
describe 'update_status' do