You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
784 B

  1. require 'rails_helper'
  2. describe ActivityPub::MoveDistributionWorker do
  3. subject { described_class.new }
  4. let(:migration) { Fabricate(:account_migration) }
  5. let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com') }
  6. let(:blocker) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example2.com') }
  7. describe '#perform' do
  8. before do
  9. allow(ActivityPub::DeliveryWorker).to receive(:push_bulk)
  10. follower.follow!(migration.account)
  11. blocker.block!(migration.account)
  12. end
  13. it 'delivers to followers and known blockers' do
  14. subject.perform(migration.id)
  15. expect(ActivityPub::DeliveryWorker).to have_received(:push_bulk).with(['http://example.com', 'http://example2.com'])
  16. end
  17. end
  18. end