diff options
author | ThibG <thib@sitedethib.com> | 2020-07-01 13:51:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-01 13:51:15 +0200 |
commit | 35cedc922ced6502f18b11353df661cf61c8ae2f (patch) | |
tree | 10c12d29a781dc398df9a98e7ec4a40183975cc8 /spec/workers/activitypub | |
parent | 411bf188bbb9acb48b7bb1a14066f4975e036940 (diff) |
Change move handler to carry blocks over (#14144)
* Change move handler to carry blocks and mutes over When user A blocks user B and B moves to a new account C, make A block C accordingly. Note that it only works if A's instance is aware of the Move, that is, if B is on A's instance or has followers there. * Also notify instances with known people blocking you when moving * Add automatic account notes when blocking/muting an account that had no note
Diffstat (limited to 'spec/workers/activitypub')
-rw-r--r-- | spec/workers/activitypub/move_distribution_worker_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/workers/activitypub/move_distribution_worker_spec.rb b/spec/workers/activitypub/move_distribution_worker_spec.rb new file mode 100644 index 000000000..b52788e54 --- /dev/null +++ b/spec/workers/activitypub/move_distribution_worker_spec.rb @@ -0,0 +1,22 @@ +require 'rails_helper' + +describe ActivityPub::MoveDistributionWorker do + subject { described_class.new } + + let(:migration) { Fabricate(:account_migration) } + let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com') } + let(:blocker) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example2.com') } + + describe '#perform' do + before do + allow(ActivityPub::DeliveryWorker).to receive(:push_bulk) + follower.follow!(migration.account) + blocker.block!(migration.account) + end + + it 'delivers to followers and known blockers' do + subject.perform(migration.id) + expect(ActivityPub::DeliveryWorker).to have_received(:push_bulk).with(['http://example.com', 'http://example2.com']) + end + end +end |