Fix: スタンプのテスト
This commit is contained in:
parent
5ac46b4dc6
commit
e7e70b21d2
3 changed files with 18 additions and 3 deletions
|
@ -43,6 +43,14 @@ class EmojiReaction < ApplicationRecord
|
||||||
custom_emoji? && !custom_emoji.local?
|
custom_emoji? && !custom_emoji.local?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def sign?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
def object_type
|
||||||
|
:emoji_reaction
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def refresh_cache
|
def refresh_cache
|
||||||
|
|
7
spec/fabricators/emoji_reaction_fabricator.rb
Normal file
7
spec/fabricators/emoji_reaction_fabricator.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
Fabricator(:emoji_reaction) do
|
||||||
|
account { Fabricate.build(:account) }
|
||||||
|
status { Fabricate.build(:status) }
|
||||||
|
name '😀'
|
||||||
|
end
|
|
@ -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