mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-09-12 05:07:06 +00:00
21 lines
579 B
Ruby
21 lines
579 B
Ruby
|
require 'rails_helper'
|
||
|
|
||
|
describe ActivityPub::UpdateDistributionWorker do
|
||
|
subject { described_class.new }
|
||
|
|
||
|
let(:account) { Fabricate(:account) }
|
||
|
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com') }
|
||
|
|
||
|
describe '#perform' do
|
||
|
before do
|
||
|
allow(ActivityPub::DeliveryWorker).to receive(:push_bulk)
|
||
|
follower.follow!(account)
|
||
|
end
|
||
|
|
||
|
it 'delivers to followers' do
|
||
|
subject.perform(account.id)
|
||
|
expect(ActivityPub::DeliveryWorker).to have_received(:push_bulk).with(['http://example.com'])
|
||
|
end
|
||
|
end
|
||
|
end
|