From 16305293583519d2a6c74be8a4763e61874439c0 Mon Sep 17 00:00:00 2001 From: KMY Date: Wed, 11 Oct 2023 10:24:35 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/fabricators/emoji_reaction_fabricator.rb | 7 +++++ spec/lib/activitypub/activity/undo_spec.rb | 27 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 spec/fabricators/emoji_reaction_fabricator.rb diff --git a/spec/fabricators/emoji_reaction_fabricator.rb b/spec/fabricators/emoji_reaction_fabricator.rb new file mode 100644 index 0000000000..2605a9f232 --- /dev/null +++ b/spec/fabricators/emoji_reaction_fabricator.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +Fabricator(:emoji_reaction) do + account { Fabricate.build(:account) } + status { Fabricate.build(:status) } + name '😀' +end diff --git a/spec/lib/activitypub/activity/undo_spec.rb b/spec/lib/activitypub/activity/undo_spec.rb index 4634cb967e..feda725654 100644 --- a/spec/lib/activitypub/activity/undo_spec.rb +++ b/spec/lib/activitypub/activity/undo_spec.rb @@ -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