update_distribution_worker_spec.rb 610 B

12345678910111213141516171819202122
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe ActivityPub::UpdateDistributionWorker do
  4. subject { described_class.new }
  5. let(:account) { Fabricate(:account) }
  6. let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com', domain: 'example.com') }
  7. describe '#perform' do
  8. before do
  9. follower.follow!(account)
  10. end
  11. it 'delivers to followers' do
  12. expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [[kind_of(String), account.id, 'http://example.com', anything]]) do
  13. subject.perform(account.id)
  14. end
  15. end
  16. end
  17. end