Skip to content

Commit

Permalink
修正
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode committed Oct 11, 2023
1 parent e3a43d4 commit 1630529
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/fabricators/emoji_reaction_fabricator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

Fabricator(:emoji_reaction) do
account { Fabricate.build(:account) }
status { Fabricate.build(:status) }
name '😀'
end
27 changes: 27 additions & 0 deletions spec/lib/activitypub/activity/undo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,32 @@
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

0 comments on commit 1630529

Please sign in to comment.