From d57a5d3e8c62e763ce7f76a9d42ef5814bd5623a Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 1 Jun 2018 11:56:56 +0800 Subject: [PATCH] Fix brittle spec. --- spec/models/user_profile_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/models/user_profile_spec.rb b/spec/models/user_profile_spec.rb index ee05902c3ec..98545ffabe9 100644 --- a/spec/models/user_profile_spec.rb +++ b/spec/models/user_profile_spec.rb @@ -114,19 +114,19 @@ describe UserProfile do describe 'bio excerpt emojis' do let(:user) { Fabricate(:user) } + let(:upload) { Fabricate(:upload) } before do - CustomEmoji.create!(name: 'test', upload_id: 1) + CustomEmoji.create!(name: 'test', upload: upload) Emoji.clear_cache - user.user_profile.bio_raw = "hello :test: :woman_scientist:t5: 🤔" - user.user_profile.save - user.user_profile.reload + user.user_profile.update!( + bio_raw: "hello :test: :woman_scientist:t5: 🤔" + ) end it 'supports emoji images' do - - expect(user.user_profile.bio_excerpt(500, keep_emoji_images: true)).to eq("hello \":test:\" \":woman_scientist:t5:\" \":thinking:\"") + expect(user.user_profile.bio_excerpt(500, keep_emoji_images: true)).to eq("hello \":test:\" \":woman_scientist:t5:\" \":thinking:\"") end end