修正
This commit is contained in:
parent
e3a43d4758
commit
1630529358
2 changed files with 34 additions and 0 deletions
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
|
|
@ -213,5 +213,32 @@ RSpec.describe ActivityPub::Activity::Undo do
|
|||
expect(sender.favourited?(status)).to be false
|
||||
end
|
||||
end
|
||||
|
||||
context 'with EmojiReact' do
|
||||
let(:status) { Fabricate(:status) }
|
||||
|
||||
let(:content) { '😀' }
|
||||
let(:object_json) do
|
||||
{
|
||||
id: 'bar',
|
||||
type: 'Like',
|
||||
actor: ActivityPub::TagManager.instance.uri_for(sender),
|
||||
object: ActivityPub::TagManager.instance.uri_for(status),
|
||||
content: content,
|
||||
}
|
||||
end
|
||||
|
||||
before do
|
||||
Fabricate(:favourite, account: sender, status: status)
|
||||
Fabricate(:emoji_reaction, account: sender, status: status, name: content)
|
||||
end
|
||||
|
||||
it 'delete emoji reaction' do
|
||||
subject.perform
|
||||
reaction = EmojiReaction.find_by(account: sender, status: status)
|
||||
expect(reaction).to be_nil
|
||||
expect(sender.favourited?(status)).to be true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue