diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/lib/banzai/filter/emoji_filter_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/lib/banzai/filter/emoji_filter_spec.rb')
-rw-r--r-- | spec/lib/banzai/filter/emoji_filter_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/emoji_filter_spec.rb b/spec/lib/banzai/filter/emoji_filter_spec.rb index d78763b6939..9005b4401b7 100644 --- a/spec/lib/banzai/filter/emoji_filter_spec.rb +++ b/spec/lib/banzai/filter/emoji_filter_spec.rb @@ -21,6 +21,20 @@ RSpec.describe Banzai::Filter::EmojiFilter do expect(doc.to_html).to match Regexp.escape(exp) end + it 'ignores unicode versions of trademark, copyright, and registered trademark' do + exp = act = '<p>™ © ®</p>' + doc = filter(act) + expect(doc.to_html).to match Regexp.escape(exp) + end + + it 'replaces name versions of trademark, copyright, and registered trademark' do + doc = filter('<p>:tm: :copyright: :registered:</p>') + + expect(doc.css('gl-emoji')[0].text).to eq '™' + expect(doc.css('gl-emoji')[1].text).to eq '©' + expect(doc.css('gl-emoji')[2].text).to eq '®' + end + it 'correctly encodes the URL' do doc = filter('<p>:+1:</p>') expect(doc.css('gl-emoji').first.text).to eq '👍' |