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/block_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/block_spec.rb')
-rw-r--r-- | spec/lib/activitypub/activity/block_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/lib/activitypub/activity/block_spec.rb b/spec/lib/activitypub/activity/block_spec.rb index 94d37356d..42bdfdc81 100644 --- a/spec/lib/activitypub/activity/block_spec.rb +++ b/spec/lib/activitypub/activity/block_spec.rb @@ -28,6 +28,28 @@ RSpec.describe ActivityPub::Activity::Block do end end + context 'when the recipient is already blocked' do + before do + sender.block!(recipient, uri: 'old') + end + + describe '#perform' do + subject { described_class.new(json, sender) } + + before do + subject.perform + end + + it 'creates a block from sender to recipient' do + expect(sender.blocking?(recipient)).to be true + end + + it 'sets the uri to that of last received block activity' do + expect(sender.block_relationships.find_by(target_account: recipient).uri).to eq 'foo' + end + end + end + context 'when the recipient follows the sender' do before do recipient.follow!(sender) |