summaryrefslogtreecommitdiff
path: root/spec/lib/banzai
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2017-04-25 21:06:24 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2017-04-25 21:06:24 +1100
commit31c990cc41e2dc7576cf867a313862a07fd8c170 (patch)
tree57e14d914aee3a81b11ad29f05395ec9d2fed2ba /spec/lib/banzai
parenta62ae94d9c5940e87679b1ce8a0aee8b82b4d59e (diff)
downloadgitlab-ce-31c990cc41e2dc7576cf867a313862a07fd8c170.tar.gz
Fix rendering emoji inside a string
Diffstat (limited to 'spec/lib/banzai')
-rw-r--r--spec/lib/banzai/filter/emoji_filter_spec.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/lib/banzai/filter/emoji_filter_spec.rb b/spec/lib/banzai/filter/emoji_filter_spec.rb
index 707212e07fd..086a006c45f 100644
--- a/spec/lib/banzai/filter/emoji_filter_spec.rb
+++ b/spec/lib/banzai/filter/emoji_filter_spec.rb
@@ -68,9 +68,9 @@ describe Banzai::Filter::EmojiFilter, lib: true do
expect(doc.css('gl-emoji').size).to eq 1
end
- it 'matches multiple emoji in a row' do
+ it 'does not match multiple emoji in a row' do
doc = filter(':see_no_evil::hear_no_evil::speak_no_evil:')
- expect(doc.css('gl-emoji').size).to eq 3
+ expect(doc.css('gl-emoji').size).to eq 0
end
it 'unicode matches multiple emoji in a row' do
@@ -83,6 +83,12 @@ describe Banzai::Filter::EmojiFilter, lib: true do
expect(doc.css('gl-emoji').size).to eq 6
end
+ it 'does not match emoji in a string' do
+ doc = filter("'2a00:a4c0:100::1'")
+
+ expect(doc.css('gl-emoji').size).to eq 0
+ end
+
it 'has a data-name attribute' do
doc = filter(':-1:')
expect(doc.css('gl-emoji').first.attr('data-name')).to eq 'thumbsdown'