diff --git a/app/models/emoji_reaction.rb b/app/models/emoji_reaction.rb index ce0a7dfb2edb4d..f97679347ce0f1 100644 --- a/app/models/emoji_reaction.rb +++ b/app/models/emoji_reaction.rb @@ -43,6 +43,14 @@ def remote_custom_emoji? custom_emoji? && !custom_emoji.local? end + def sign? + true + end + + def object_type + :emoji_reaction + end + private def refresh_cache diff --git a/spec/fabricators/emoji_reaction_fabricator.rb b/spec/fabricators/emoji_reaction_fabricator.rb new file mode 100644 index 00000000000000..2605a9f232766c --- /dev/null +++ b/spec/fabricators/emoji_reaction_fabricator.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +Fabricator(:emoji_reaction) do + account { Fabricate.build(:account) } + status { Fabricate.build(:status) } + name '😀' +end diff --git a/spec/services/emoji_react_service_spec.rb b/spec/services/emoji_react_service_spec.rb index 62d81d57c5e869..629a7818d44e0c 100644 --- a/spec/services/emoji_react_service_spec.rb +++ b/spec/services/emoji_react_service_spec.rb @@ -99,7 +99,7 @@ context 'with custom emoji of remote' do let(:name) { 'ohagi@foo.bar' } - let!(:custom_emoji) { Fabricate(:custom_emoji, shortcode: 'ohagi', domain: 'foo.bar') } + let!(:custom_emoji) { Fabricate(:custom_emoji, shortcode: 'ohagi', domain: 'foo.bar', uri: 'https://foo.bar/emoji/ohagi') } before { Fabricate(:emoji_reaction, status: status, name: 'ohagi', custom_emoji: custom_emoji) } @@ -113,7 +113,7 @@ context 'with custom emoji of remote without existing one' do let(:name) { 'ohagi@foo.bar' } - before { Fabricate(:custom_emoji, shortcode: 'ohagi', domain: 'foo.bar') } + before { Fabricate(:custom_emoji, shortcode: 'ohagi', domain: 'foo.bar', uri: 'https://foo.bar/emoji/ohagi') } it 'react with emoji' do expect(subject.count).to eq 0 @@ -122,7 +122,7 @@ context 'with custom emoji of remote but local has same name emoji' do let(:name) { 'ohagi@foo.bar' } - let!(:custom_emoji) { Fabricate(:custom_emoji, shortcode: 'ohagi', domain: 'foo.bar') } + let!(:custom_emoji) { Fabricate(:custom_emoji, shortcode: 'ohagi', domain: 'foo.bar', uri: 'https://foo.bar/emoji/ohagi') } before do Fabricate(:custom_emoji, shortcode: 'ohagi', domain: nil)