Fix: スタンプのテスト
This commit is contained in:
parent
92301d59a4
commit
e1e8476e1f
2 changed files with 8 additions and 4 deletions
|
@ -40,7 +40,11 @@ class EmojiReaction < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def sign?
|
def sign?
|
||||||
status&.distributable_friend?
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
def object_type
|
||||||
|
:emoji_reaction
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -99,7 +99,7 @@ RSpec.describe EmojiReactService, type: :service do
|
||||||
|
|
||||||
context 'with custom emoji of remote' do
|
context 'with custom emoji of remote' do
|
||||||
let(:name) { 'ohagi@foo.bar' }
|
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) }
|
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
|
context 'with custom emoji of remote without existing one' do
|
||||||
let(:name) { 'ohagi@foo.bar' }
|
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
|
it 'react with emoji' do
|
||||||
expect(subject.count).to eq 0
|
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
|
context 'with custom emoji of remote but local has same name emoji' do
|
||||||
let(:name) { 'ohagi@foo.bar' }
|
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
|
before do
|
||||||
Fabricate(:custom_emoji, shortcode: 'ohagi', domain: nil)
|
Fabricate(:custom_emoji, shortcode: 'ohagi', domain: nil)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue