2023-02-22 00:55:31 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-12 22:44:41 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe ActivityPub::UpdateDistributionWorker do
|
|
|
|
subject { described_class.new }
|
|
|
|
|
|
|
|
let(:account) { Fabricate(:account) }
|
2023-07-20 16:23:48 +00:00
|
|
|
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com', domain: 'example.com') }
|
2017-08-12 22:44:41 +00:00
|
|
|
|
|
|
|
describe '#perform' do
|
|
|
|
before do
|
|
|
|
follower.follow!(account)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'delivers to followers' do
|
2024-06-19 13:46:52 +00:00
|
|
|
expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [[match_json_values(type: 'Update'), account.id, 'http://example.com', anything]]) do
|
2023-11-07 09:46:28 +00:00
|
|
|
subject.perform(account.id)
|
|
|
|
end
|
2017-08-12 22:44:41 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|