diff options
author | ThibG <thib@sitedethib.com> | 2020-07-22 15:39:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-22 15:39:36 +0200 |
commit | 4024952b58bacb94d2cb43fafddf0e97bea4c55c (patch) | |
tree | b1c1e5cdb84606879d65ecceebe4cf665332379b /spec/lib/activitypub/activity/undo_spec.rb | |
parent | 801e546ecc1efb4103232d8265229eb455a8dd5b (diff) | |
parent | f8e315cd74d05a6878bbd018b20462daa0b5e660 (diff) |
Merge pull request #1385 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/lib/activitypub/activity/undo_spec.rb')
-rw-r--r-- | spec/lib/activitypub/activity/undo_spec.rb | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/spec/lib/activitypub/activity/undo_spec.rb b/spec/lib/activitypub/activity/undo_spec.rb index 9545e1f46..c0309e49d 100644 --- a/spec/lib/activitypub/activity/undo_spec.rb +++ b/spec/lib/activitypub/activity/undo_spec.rb @@ -50,6 +50,19 @@ RSpec.describe ActivityPub::Activity::Undo do expect(sender.reblogged?(status)).to be false end end + + context 'with only object uri' do + let(:object_json) { 'bar' } + + before do + Fabricate(:status, reblog: status, account: sender, uri: 'bar') + end + + it 'deletes the reblog by uri' do + subject.perform + expect(sender.reblogged?(status)).to be false + end + end end context 'with Accept' do @@ -91,13 +104,22 @@ RSpec.describe ActivityPub::Activity::Undo do end before do - sender.block!(recipient) + sender.block!(recipient, uri: 'bar') end it 'deletes block from sender to recipient' do subject.perform expect(sender.blocking?(recipient)).to be false end + + context 'with only object uri' do + let(:object_json) { 'bar' } + + it 'deletes block from sender to recipient' do + subject.perform + expect(sender.blocking?(recipient)).to be false + end + end end context 'with Follow' do @@ -113,13 +135,22 @@ RSpec.describe ActivityPub::Activity::Undo do end before do - sender.follow!(recipient) + sender.follow!(recipient, uri: 'bar') end it 'deletes follow from sender to recipient' do subject.perform expect(sender.following?(recipient)).to be false end + + context 'with only object uri' do + let(:object_json) { 'bar' } + + it 'deletes follow from sender to recipient' do + subject.perform + expect(sender.following?(recipient)).to be false + end + end end context 'with Like' do |