summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-05 13:10:20 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-05 13:10:20 +0100
commitb2ab11a91785ffe0316e38687837e165fad3eb65 (patch)
tree6901ab4a86c8175aff6c5c0bf4c306ef2a713cd8
parentd28f5e776b90a648a83246beac94518cd8183af4 (diff)
downloadgitlab-ce-b2ab11a91785ffe0316e38687837e165fad3eb65.tar.gz
Extend tests for pipeline status factory
-rw-r--r--spec/lib/gitlab/ci/status/pipeline/factory_spec.rb19
1 files changed, 16 insertions, 3 deletions
diff --git a/spec/lib/gitlab/ci/status/pipeline/factory_spec.rb b/spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
index 9f251735067..543dae0640d 100644
--- a/spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
+++ b/spec/lib/gitlab/ci/status/pipeline/factory_spec.rb
@@ -5,6 +5,10 @@ describe Gitlab::Ci::Status::Pipeline::Factory do
described_class.new(pipeline)
end
+ let(:status) do
+ subject.fabricate!
+ end
+
context 'when pipeline has a core status' do
HasStatus::AVAILABLE_STATUSES.each do |core_status|
context "when core status is #{core_status}" do
@@ -13,8 +17,13 @@ describe Gitlab::Ci::Status::Pipeline::Factory do
end
it "fabricates a core status #{core_status}" do
- expect(subject.fabricate!)
- .to be_a Gitlab::Ci::Status.const_get(core_status.capitalize)
+ expect(status).to be_a(
+ Gitlab::Ci::Status.const_get(core_status.capitalize))
+ end
+
+ it 'extends core status with common pipeline methods' do
+ expect(status).to have_details
+ expect(status.details_path).to include "pipelines/#{pipeline.id}"
end
end
end
@@ -30,8 +39,12 @@ describe Gitlab::Ci::Status::Pipeline::Factory do
end
it 'fabricates extended "success with warnings" status' do
- expect(subject.fabricate!)
+ expect(status)
.to be_a Gitlab::Ci::Status::Pipeline::SuccessWithWarnings
end
+
+ it 'extends core status with common pipeline methods' do
+ expect(status).to have_details
+ end
end
end