2023-02-22 11:55:31 +11:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-07-01 21:51:15 +10:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe ActivityPub::MoveDistributionWorker do
|
|
|
|
subject { described_class.new }
|
|
|
|
|
2023-02-18 08:56:20 +11:00
|
|
|
let(:migration) { Fabricate(:account_migration) }
|
2023-07-21 02:23:48 +10:00
|
|
|
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com', domain: 'example.com') }
|
|
|
|
let(:blocker) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example2.com', domain: 'example2.com') }
|
2020-07-01 21:51:15 +10:00
|
|
|
|
|
|
|
describe '#perform' do
|
|
|
|
before do
|
|
|
|
follower.follow!(migration.account)
|
|
|
|
blocker.block!(migration.account)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'delivers to followers and known blockers' do
|
2022-02-11 05:42:45 +11:00
|
|
|
expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [
|
2023-02-18 08:56:20 +11:00
|
|
|
[kind_of(String), migration.account.id, 'http://example.com'],
|
2023-02-19 08:54:30 +11:00
|
|
|
[kind_of(String), migration.account.id, 'http://example2.com'],
|
2023-02-18 08:56:20 +11:00
|
|
|
])
|
2020-07-01 21:51:15 +10:00
|
|
|
subject.perform(migration.id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|