2023-02-22 00:55:31 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-06-27 17:41:55 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe ActivityPub::DistributePollUpdateWorker 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') }
|
2019-06-27 17:41:55 +00:00
|
|
|
let(:poll) { Fabricate(:poll, account: account) }
|
|
|
|
let!(:status) { Fabricate(:status, account: account, poll: poll) }
|
|
|
|
|
|
|
|
describe '#perform' do
|
|
|
|
before do
|
|
|
|
follower.follow!(account)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'delivers to followers' do
|
2022-02-10 18:42:45 +00:00
|
|
|
expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [[kind_of(String), account.id, 'http://example.com']])
|
2019-06-27 17:41:55 +00:00
|
|
|
subject.perform(status.id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|