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:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-27 14:48:01 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-27 14:48:01 +0300
commit1b14182f21a60384234e79b3a0f02c81d016192d (patch)
treec244009f20c46b39ed65432b7c39105c3dd9fcde /spec/serializers/stage_entity_spec.rb
parentf9331db136f19dfdc6b2affa0922bdcda7c681fc (diff)
Expose stage dropdown path and title in stage entity
Diffstat (limited to 'spec/serializers/stage_entity_spec.rb')
-rw-r--r--spec/serializers/stage_entity_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/serializers/stage_entity_spec.rb b/spec/serializers/stage_entity_spec.rb
index 807e09f860a..4ab40d08432 100644
--- a/spec/serializers/stage_entity_spec.rb
+++ b/spec/serializers/stage_entity_spec.rb
@@ -15,6 +15,7 @@ describe StageEntity do
before do
allow(request).to receive(:user).and_return(user)
+ create(:ci_build, :success, pipeline: pipeline)
end
describe '#as_json' do
@@ -26,6 +27,7 @@ describe StageEntity do
it 'contains detailed status' do
expect(subject[:status]).to include :text, :label, :group, :icon
+ expect(subject[:status][:label]).to eq 'passed'
end
it 'contains valid name' do
@@ -36,5 +38,14 @@ describe StageEntity do
expect(subject[:path])
.to include "pipelines/#{pipeline.id}##{stage.name}"
end
+
+ it 'contains path to the stage dropdown' do
+ expect(subject[:dropdown_path])
+ .to include "pipelines/#{pipeline.id}/stage.json?stage=test"
+ end
+
+ it 'contains stage title' do
+ expect(subject[:title]).to eq 'test: passed'
+ end
end
end