FEATURE: remap emojis back for push notifications and desktop alerts

This commit is contained in:
Sam
2016-10-11 13:03:48 +11:00
parent 6031e692f0
commit 89daa43754
5 changed files with 28 additions and 7 deletions
+5
View File
@@ -265,6 +265,11 @@ HTML
expect(PrettyText.excerpt(emoji_image, 100, { keep_emoji_images: true })).to match_html(emoji_image)
end
it "should have an option to remap emoji to code points" do
emoji_image = "I <img src='/images/emoji/emoji_one/heart.png?v=1' title=':heart:' class='emoji' alt=':heart:'> you <img src='/images/emoji/emoji_one/heart.png?v=1' title=':unknown:' class='emoji' alt=':unknown:'> "
expect(PrettyText.excerpt(emoji_image, 100, { remap_emoji: true })).to match_html("I ❤ you :unknown:")
end
it "should have an option to preserve emoji codes" do
emoji_code = "<img src='/images/emoji/emoji_one/heart.png?v=1' title=':heart:' class='emoji' alt=':heart:'>"
expect(PrettyText.excerpt(emoji_code, 100)).to eq(":heart:")