diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2016-12-22 17:12:16 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2016-12-22 17:12:16 +0300 |
commit | deb3cd7153f6ad5ee9ec14c1d360102d8d6102c3 (patch) | |
tree | 6eeb4d3f13f34e95fafd6672e9c6ccde1926ebaa | |
parent | a1aa0d7829445400053157e6dae4c610c494cb52 (diff) | |
parent | 3f9095722c0d78524e9e9bd4b3c343ace3d09f31 (diff) |
Merge branch 'fix/hide-retried-builds-in-pipeline-stage-dropdown' into 'master'
Do not show retried builds in pipeline stage dropdown
Closes #25980
See merge request !8260
3 files changed, 43 insertions, 7 deletions
diff --git a/app/views/projects/pipelines/_stage.html.haml b/app/views/projects/pipelines/_stage.html.haml index 20456e792e7..cf1b366bf2c 100644 --- a/app/views/projects/pipelines/_stage.html.haml +++ b/app/views/projects/pipelines/_stage.html.haml @@ -1,4 +1,4 @@ %ul - - @stage.statuses.each do |status| + - @stage.statuses.latest.each do |status| %li.dropdown-build = render 'ci/status/graph_badge', subject: status diff --git a/changelogs/unreleased/fix-hide-retried-builds-in-pipeline-stage-dropdown.yml b/changelogs/unreleased/fix-hide-retried-builds-in-pipeline-stage-dropdown.yml new file mode 100644 index 00000000000..66256d7ed0e --- /dev/null +++ b/changelogs/unreleased/fix-hide-retried-builds-in-pipeline-stage-dropdown.yml @@ -0,0 +1,4 @@ +--- +title: Do not show retried builds in pipeline stage dropdown +merge_request: 8260 +author: 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 |