summaryrefslogtreecommitdiff
path: root/spec/models/ci/stage_spec.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-06-04 11:29:39 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-06-04 11:29:39 +0200
commit114c26ccf0f10788271c6108774e72809a7f93e1 (patch)
tree1476e038b966c2b31d4d4a838fd245bc7ccab3dd /spec/models/ci/stage_spec.rb
parent93241149e646f546e9a4406e85ced66c8d54099f (diff)
downloadgitlab-ce-114c26ccf0f10788271c6108774e72809a7f93e1.tar.gz
Raise error if pipeline / stage hits unknown status
Diffstat (limited to 'spec/models/ci/stage_spec.rb')
-rw-r--r--spec/models/ci/stage_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/ci/stage_spec.rb b/spec/models/ci/stage_spec.rb
index b40496252b4..22a4556c10c 100644
--- a/spec/models/ci/stage_spec.rb
+++ b/spec/models/ci/stage_spec.rb
@@ -110,6 +110,19 @@ describe Ci::Stage, :models do
expect(stage.reload).to be_failed
end
end
+
+ context 'when statuses status was not recognized' do
+ before do
+ allow(stage)
+ .to receive_message_chain(:statuses, :latest, :status)
+ .and_return(:unknown)
+ end
+
+ it 'raises an exception' do
+ expect { stage.update_status }
+ .to raise_error(HasStatus::UnknownStatusError)
+ end
+ end
end
describe '#detailed_status' do