Skip to content

Commit e7e70b2

Browse files
committed
Fix: スタンプのテスト
1 parent 5ac46b4 commit e7e70b2

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

app/models/emoji_reaction.rb

+8
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ def remote_custom_emoji?
4343
custom_emoji? && !custom_emoji.local?
4444
end
4545

46+
def sign?
47+
true
48+
end
49+
50+
def object_type
51+
:emoji_reaction
52+
end
53+
4654
private
4755

4856
def refresh_cache
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
Fabricator(:emoji_reaction) do
4+
account { Fabricate.build(:account) }
5+
status { Fabricate.build(:status) }
6+
name '😀'
7+
end

spec/services/emoji_react_service_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999

100100
context 'with custom emoji of remote' do
101101
let(:name) { '[email protected]' }
102-
let!(:custom_emoji) { Fabricate(:custom_emoji, shortcode: 'ohagi', domain: 'foo.bar') }
102+
let!(:custom_emoji) { Fabricate(:custom_emoji, shortcode: 'ohagi', domain: 'foo.bar', uri: 'https://foo.bar/emoji/ohagi') }
103103

104104
before { Fabricate(:emoji_reaction, status: status, name: 'ohagi', custom_emoji: custom_emoji) }
105105

@@ -113,7 +113,7 @@
113113
context 'with custom emoji of remote without existing one' do
114114
let(:name) { '[email protected]' }
115115

116-
before { Fabricate(:custom_emoji, shortcode: 'ohagi', domain: 'foo.bar') }
116+
before { Fabricate(:custom_emoji, shortcode: 'ohagi', domain: 'foo.bar', uri: 'https://foo.bar/emoji/ohagi') }
117117

118118
it 'react with emoji' do
119119
expect(subject.count).to eq 0
@@ -122,7 +122,7 @@
122122

123123
context 'with custom emoji of remote but local has same name emoji' do
124124
let(:name) { '[email protected]' }
125-
let!(:custom_emoji) { Fabricate(:custom_emoji, shortcode: 'ohagi', domain: 'foo.bar') }
125+
let!(:custom_emoji) { Fabricate(:custom_emoji, shortcode: 'ohagi', domain: 'foo.bar', uri: 'https://foo.bar/emoji/ohagi') }
126126

127127
before do
128128
Fabricate(:custom_emoji, shortcode: 'ohagi', domain: nil)

0 commit comments

Comments
 (0)