mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: ensures emoji helper is working with custom emojis (#7843)
This commit is contained in:
@@ -7,10 +7,14 @@ describe EmojiHelper do
|
||||
|
||||
describe "emoji_codes_to_img" do
|
||||
it "replaces emoji codes by images" do
|
||||
str = "This is a good day :woman: :man:t4:"
|
||||
Plugin::CustomEmoji.register("xxxxxx", "/public/xxxxxx.png")
|
||||
|
||||
str = "This is a good day :xxxxxx: :woman: :man:t4:"
|
||||
replaced_str = helper.emoji_codes_to_img(str)
|
||||
|
||||
expect(replaced_str).to eq("This is a good day <img src=\"/images/emoji/twitter/woman.png?v=#{Emoji::EMOJI_VERSION}\" title=\"woman\" class=\"emoji\" alt=\"woman\"> <img src=\"/images/emoji/twitter/man/4.png?v=#{Emoji::EMOJI_VERSION}\" title=\"man:t4\" class=\"emoji\" alt=\"man:t4\">")
|
||||
expect(replaced_str).to eq("This is a good day <img src=\"/public/xxxxxx.png\" title=\"xxxxxx\" class=\"emoji\" alt=\"xxxxxx\"> <img src=\"/images/emoji/twitter/woman.png?v=#{Emoji::EMOJI_VERSION}\" title=\"woman\" class=\"emoji\" alt=\"woman\"> <img src=\"/images/emoji/twitter/man/4.png?v=#{Emoji::EMOJI_VERSION}\" title=\"man:t4\" class=\"emoji\" alt=\"man:t4\">")
|
||||
|
||||
Plugin::CustomEmoji.unregister("xxxxxx")
|
||||
end
|
||||
|
||||
it "doesn't replace if code doesn't exist" do
|
||||
|
||||
Reference in New Issue
Block a user