summaryrefslogtreecommitdiff
path: root/spec/helpers/markup_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-02 15:06:18 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-02 15:06:18 +0000
commit8423ed74e617cfba4a94f31a03c2ae0d799bf82f (patch)
tree6fc2efa0d1e24296b1cfba033cf67ccc5ddf4ac4 /spec/helpers/markup_helper_spec.rb
parent2af6d2c4378762ee07a70c3a8086f10e716bb011 (diff)
downloadgitlab-ce-8423ed74e617cfba4a94f31a03c2ae0d799bf82f.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers/markup_helper_spec.rb')
-rw-r--r--spec/helpers/markup_helper_spec.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/helpers/markup_helper_spec.rb b/spec/helpers/markup_helper_spec.rb
index 32851249b2e..683c04428ab 100644
--- a/spec/helpers/markup_helper_spec.rb
+++ b/spec/helpers/markup_helper_spec.rb
@@ -210,7 +210,7 @@ describe MarkupHelper do
it 'replaces commit message with emoji to link' do
actual = link_to_markdown(':book: Book', '/foo')
expect(actual)
- .to eq '<gl-emoji title="open book" data-name="book" data-unicode-version="6.0">📖</gl-emoji><a href="/foo"> Book</a>'
+ .to eq '<a href="/foo"><gl-emoji title="open book" data-name="book" data-unicode-version="6.0">📖</gl-emoji></a><a href="/foo"> Book</a>'
end
end
@@ -232,6 +232,12 @@ describe MarkupHelper do
expect(doc.css('a')[0].attr('href')).to eq link
expect(doc.css('a')[0].text).to eq 'This should finally fix '
end
+
+ it "escapes HTML passed as an emoji" do
+ rendered = '<gl-emoji>&lt;div class="test"&gt;test&lt;/div&gt;</gl-emoji>'
+ expect(helper.link_to_html(rendered, '/foo'))
+ .to eq '<a href="/foo"><gl-emoji>&lt;div class="test"&gt;test&lt;/div&gt;</gl-emoji></a>'
+ end
end
describe '#render_wiki_content' do