diff options
-rw-r--r-- | app/presenters/ci/pipeline_presenter.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/609120-ref-link.yml | 5 | ||||
-rw-r--r-- | spec/features/projects/pipelines/pipeline_spec.rb | 6 |
3 files changed, 12 insertions, 1 deletions
diff --git a/app/presenters/ci/pipeline_presenter.rb b/app/presenters/ci/pipeline_presenter.rb index 944895904fe..358473d0a74 100644 --- a/app/presenters/ci/pipeline_presenter.rb +++ b/app/presenters/ci/pipeline_presenter.rb @@ -43,7 +43,7 @@ module Ci if pipeline.ref_exists? _("for %{link_to_pipeline_ref}").html_safe % { link_to_pipeline_ref: link_to_pipeline_ref } else - _("for %{ref}") % { ref: content_tag(:span, pipeline.ref, class: 'ref-name') } + _("for %{ref}").html_safe % { ref: content_tag(:span, pipeline.ref, class: 'ref-name') } end end end diff --git a/changelogs/unreleased/609120-ref-link.yml b/changelogs/unreleased/609120-ref-link.yml new file mode 100644 index 00000000000..97c93b7ff53 --- /dev/null +++ b/changelogs/unreleased/609120-ref-link.yml @@ -0,0 +1,5 @@ +--- +title: Fixes Ref link being displayed as raw HTML in the Pipelines page +merge_request: 28823 +author: +type: fixed diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index a1115b514d3..506aa867490 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -328,6 +328,12 @@ describe 'Pipeline', :js do expect(page).not_to have_link(pipeline.ref) expect(page).to have_content(pipeline.ref) end + + it 'does not render render raw HTML to the pipeline ref' do + page.within '.pipeline-info' do + expect(page).not_to have_content('<span class="ref-name"') + end + end end context 'when pipeline is detached merge request pipeline' do |