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