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-22 16:02:45 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-22 16:02:45 +0300
commitdaff64452ff79b95eda5eb33c5aea8aface98f2b (patch)
treefcdcef06e648bfc1dba8ce09d15bd2c991ddd542 /spec/views
parent6e2a6fd09167947a3bd8e1a4cda96dbfae395b3a (diff)
Do not show retried builds in pipeline stage dropdown
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/projects/pipelines/_stage.html.haml_spec.rb44
1 files changed, 38 insertions, 6 deletions
diff --git a/spec/views/projects/pipelines/_stage.html.haml_spec.rb b/spec/views/projects/pipelines/_stage.html.haml_spec.rb
index eb7f7ca4a1a..d25de8af5d2 100644
--- a/spec/views/projects/pipelines/_stage.html.haml_spec.rb
+++ b/spec/views/projects/pipelines/_stage.html.haml_spec.rb
@@ -7,15 +7,47 @@ describe 'projects/pipelines/_stage', :view do
before do
assign :stage, stage
+ end
+
+ context 'when there are only latest builds present' do
+ before do
+ create(:ci_build, name: 'test:build',
+ stage: stage.name,
+ pipeline: pipeline)
+ end
+
+ it 'shows the builds in the stage' do
+ render
+
+ expect(rendered).to have_text 'test:build'
+ end
+ end
+
+ context 'when build belongs to different stage' do
+ before do
+ create(:ci_build, name: 'test:build',
+ stage: 'other:stage',
+ pipeline: pipeline)
+ end
- create(:ci_build, name: 'test:build',
- stage: stage.name,
- pipeline: pipeline)
+ it 'does not render build' do
+ render
+
+ expect(rendered).not_to have_text 'test:build'
+ end
end
- it 'shows the builds in the stage' do
- render
+ context 'when there are retried builds present' do
+ before do
+ create_list(:ci_build, 2, name: 'test:build',
+ stage: stage.name,
+ pipeline: pipeline)
+ end
+
+ it 'shows only latest builds' do
+ render
- expect(rendered).to have_text 'test:build'
+ expect(rendered).to have_text 'test:build', count: 1
+ end
end
end