Fix: スタンプのテスト

This commit is contained in:
KMY 2023-10-15 12:19:46 +09:00
parent 92301d59a4
commit e1e8476e1f
2 changed files with 8 additions and 4 deletions

View file

@ -40,7 +40,11 @@ class EmojiReaction < ApplicationRecord
end
def sign?
status&.distributable_friend?
true
end
def object_type
:emoji_reaction
end
private

View file

@ -99,7 +99,7 @@ RSpec.describe EmojiReactService, type: :service do
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 @@ RSpec.describe EmojiReactService, type: :service do
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 @@ RSpec.describe EmojiReactService, type: :service do
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)