Commit a91101d0 authored by micael.bergeron's avatar micael.bergeron Committed by GitLab Development

rework the html_safe not to use haml's auto escaping

add feature test for inline diff in file header
parent d70c3bbc
......@@ -17,12 +17,12 @@
= blob_icon diff_file.b_mode, diff_file.file_path
- if diff_file.renamed_file?
- old_path, new_path = mark_inline_diffs(diff_file.old_path, diff_file.new_path)
- old_path, new_path = mark_inline_diffs(diff_file.old_path, diff_file.new_path).map(&:html_safe)
%strong.file-title-name.has-tooltip{ data: { title: diff_file.old_path, container: 'body' } }
!= old_path
= old_path
→
%strong.file-title-name.has-tooltip{ data: { title: diff_file.new_path, container: 'body' } }
!= new_path
= new_path
- else
%strong.file-title-name.has-tooltip{ data: { title: diff_file.file_path, container: 'body' } }
= diff_file.file_path
......
---
title: Fix the diff file header from being html escaped for renamed files.
merge_request: 14121
author:
type: fixed
......@@ -108,6 +108,19 @@ feature 'Diff file viewer', :js do
end
end
context 'renamed file' do
before do
visit_commit('6907208d755b60ebeacb2e9dfea74c92c3449a1f')
end
it 'shows the filename with diff highlight' do
within('.file-header-content') do
expect(page).to have_css('.idiff.left.right.deletion')
expect(page).to have_content('files/js/commit.coffee')
end
end
end
context 'binary file that appears to be text in the first 1024 bytes' do
before do
# The file we're visiting is smaller than 10 KB and we want it collapsed
......
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