diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb index 0a1e7f8a3c6..2d973fd3b62 100644 --- a/spec/components/pretty_text_spec.rb +++ b/spec/components/pretty_text_spec.rb @@ -432,6 +432,8 @@ HTML describe "custom emoji" do it "replaces the custom emoji" do CustomEmoji.create!(name: 'trout', upload: Fabricate(:upload)) + Emoji.clear_cache + expect(PrettyText.cook("hello :trout:")).to match(/]+trout[^>]+>/) end end diff --git a/spec/jobs/rebake_custom_emoji_posts_spec.rb b/spec/jobs/rebake_custom_emoji_posts_spec.rb index 68b554ab33c..96d40decbdd 100644 --- a/spec/jobs/rebake_custom_emoji_posts_spec.rb +++ b/spec/jobs/rebake_custom_emoji_posts_spec.rb @@ -2,12 +2,13 @@ require 'rails_helper' RSpec.describe Jobs::RebakeCustomEmojiPosts do it 'should rebake posts that are using a given custom emoji' do - custom_emoji = CustomEmoji.create!(name: 'test', upload: Fabricate(:upload)) + upload = Fabricate(:upload) + custom_emoji = CustomEmoji.create!(name: 'test', upload: upload) Emoji.clear_cache post = Fabricate(:post, raw: 'some post with :test: yay') expect(post.reload.cooked).to eq( - "

some post with \":test:\" yay

" + "

some post with \":test:\" yay

" ) custom_emoji.destroy!