diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-02 15:06:18 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-02 15:06:18 +0000 |
commit | 8423ed74e617cfba4a94f31a03c2ae0d799bf82f (patch) | |
tree | 6fc2efa0d1e24296b1cfba033cf67ccc5ddf4ac4 /spec/helpers/markup_helper_spec.rb | |
parent | 2af6d2c4378762ee07a70c3a8086f10e716bb011 (diff) | |
download | gitlab-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.rb | 8 |
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><div class="test">test</div></gl-emoji>' + expect(helper.link_to_html(rendered, '/foo')) + .to eq '<a href="/foo"><gl-emoji><div class="test">test</div></gl-emoji></a>' + end end describe '#render_wiki_content' do |