Commit 51c35a4a authored by Filipa Lacerda's avatar Filipa Lacerda

Fixes ref being displayed as raw HTML

The ref to the branch was being displayed as
raw HTML in the Pipelines page
parent 4a938724
...@@ -43,7 +43,7 @@ module Ci ...@@ -43,7 +43,7 @@ module Ci
if pipeline.ref_exists? if pipeline.ref_exists?
_("for %{link_to_pipeline_ref}").html_safe % { link_to_pipeline_ref: link_to_pipeline_ref } _("for %{link_to_pipeline_ref}").html_safe % { link_to_pipeline_ref: link_to_pipeline_ref }
else 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 end
end end
......
---
title: Fixes Ref link being displayed as raw HTML in the Pipelines page
merge_request: 28823
author:
type: fixed
...@@ -328,6 +328,12 @@ describe 'Pipeline', :js do ...@@ -328,6 +328,12 @@ describe 'Pipeline', :js do
expect(page).not_to have_link(pipeline.ref) expect(page).not_to have_link(pipeline.ref)
expect(page).to have_content(pipeline.ref) expect(page).to have_content(pipeline.ref)
end 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 end
context 'when pipeline is detached merge request pipeline' do context 'when pipeline is detached merge request pipeline' do
......
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