summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/ci/status/stage
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-01-09 12:22:19 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-01-11 13:53:17 +0100
commit8dbd1e7d0000bb08b6ac6867530bb501eadc85a4 (patch)
treeb4bf1f895aa9fa29ffc37cb06fd593c6446a8bf6 /spec/lib/gitlab/ci/status/stage
parent8b30dd9834fd4026b846b016868701d8e95ec048 (diff)
downloadgitlab-ce-8dbd1e7d0000bb08b6ac6867530bb501eadc85a4.tar.gz
Add concrete success warning status to stage factory
Diffstat (limited to 'spec/lib/gitlab/ci/status/stage')
-rw-r--r--spec/lib/gitlab/ci/status/stage/factory_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/status/stage/factory_spec.rb b/spec/lib/gitlab/ci/status/stage/factory_spec.rb
index 6f8721d30c2..a60f84be9e9 100644
--- a/spec/lib/gitlab/ci/status/stage/factory_spec.rb
+++ b/spec/lib/gitlab/ci/status/stage/factory_spec.rb
@@ -42,5 +42,27 @@ describe Gitlab::Ci::Status::Stage::Factory do
end
end
end
+
+ end
+
+ context 'when stage has warnings' do
+ let(:stage) do
+ build(:ci_stage, name: 'test', status: :success, pipeline: pipeline)
+ end
+
+ before do
+ create(:ci_build, :allowed_to_fail, :failed,
+ stage: 'test', pipeline: stage.pipeline)
+ end
+
+ it 'fabricates extended "success with warnings" status' do
+ expect(status)
+ .to be_a Gitlab::Ci::Status::SuccessWarning
+ end
+
+ it 'extends core status with common stage method' do
+ expect(status).to have_details
+ expect(status.details_path).to include "pipelines/#{pipeline.id}##{stage.name}"
+ end
end
end