闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
706 B

  1. require 'rails_helper'
  2. describe ActivityPub::DistributePollUpdateWorker do
  3. subject { described_class.new }
  4. let(:account) { Fabricate(:account) }
  5. let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com') }
  6. let(:poll) { Fabricate(:poll, account: account) }
  7. let!(:status) { Fabricate(:status, account: account, poll: poll) }
  8. describe '#perform' do
  9. before do
  10. allow(ActivityPub::DeliveryWorker).to receive(:push_bulk)
  11. follower.follow!(account)
  12. end
  13. it 'delivers to followers' do
  14. subject.perform(status.id)
  15. expect(ActivityPub::DeliveryWorker).to have_received(:push_bulk).with(['http://example.com'])
  16. end
  17. end
  18. end