Commit deb3cd71 authored by Kamil Trzciński's avatar Kamil Trzciński

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
parents a1aa0d78 3f909572
%ul %ul
- @stage.statuses.each do |status| - @stage.statuses.latest.each do |status|
%li.dropdown-build %li.dropdown-build
= render 'ci/status/graph_badge', subject: status = render 'ci/status/graph_badge', subject: status
---
title: Do not show retried builds in pipeline stage dropdown
merge_request: 8260
author:
...@@ -7,7 +7,10 @@ describe 'projects/pipelines/_stage', :view do ...@@ -7,7 +7,10 @@ describe 'projects/pipelines/_stage', :view do
before do before do
assign :stage, stage assign :stage, stage
end
context 'when there are only latest builds present' do
before do
create(:ci_build, name: 'test:build', create(:ci_build, name: 'test:build',
stage: stage.name, stage: stage.name,
pipeline: pipeline) pipeline: pipeline)
...@@ -18,4 +21,33 @@ describe 'projects/pipelines/_stage', :view do ...@@ -18,4 +21,33 @@ describe 'projects/pipelines/_stage', :view do
expect(rendered).to have_text 'test:build' expect(rendered).to have_text 'test:build'
end end
end
context 'when build belongs to different stage' do
before do
create(:ci_build, name: 'test:build',
stage: 'other:stage',
pipeline: pipeline)
end
it 'does not render build' do
render
expect(rendered).not_to have_text 'test:build'
end
end
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', count: 1
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment