Fix: すでに同じカスタム絵文字が存在する場合、スタンプを受け入れない問題

This commit is contained in:
KMY 2023-10-07 12:13:18 +09:00
parent 9b6a336a19
commit 7c09b83b7a
2 changed files with 37 additions and 6 deletions

View file

@ -93,6 +93,35 @@ RSpec.describe ActivityPub::Activity::Like do
end
end
context 'with custom emoji but that is existing on local server' do
let(:content) { ':tinking:' }
let(:tag) do
{
id: 'https://example.com/aaa',
type: 'Emoji',
icon: {
url: 'http://example.com/emoji.png',
},
name: 'tinking',
license: 'Everyone but Ohagi',
}
end
before do
Fabricate(:custom_emoji, domain: 'example.com', uri: 'https://example.com/aaa', image_remote_url: 'http://example.com/emoji.png', shortcode: 'tinking', license: 'Everyone but Ohagi')
end
it 'create emoji reaction' do
expect(subject.count).to eq 1
expect(subject.first.name).to eq 'tinking'
expect(subject.first.account).to eq sender
expect(subject.first.custom_emoji).to_not be_nil
expect(subject.first.custom_emoji.shortcode).to eq 'tinking'
expect(subject.first.custom_emoji.domain).to eq 'example.com'
expect(sender.favourited?(status)).to be false
end
end
context 'with custom emoji and custom domain' do
let(:content) { ':tinking:' }
let(:tag) do