about summary refs log tree commit diff
path: root/spec/workers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/pubsubhubbub/distribution_worker_spec.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/workers/pubsubhubbub/distribution_worker_spec.rb b/spec/workers/pubsubhubbub/distribution_worker_spec.rb
index 512adb04c..89191c084 100644
--- a/spec/workers/pubsubhubbub/distribution_worker_spec.rb
+++ b/spec/workers/pubsubhubbub/distribution_worker_spec.rb
@@ -16,10 +16,9 @@ describe Pubsubhubbub::DistributionWorker do
     let(:status) { Fabricate(:status, account: alice, text: 'Hello', visibility: :public) }
 
     it 'delivers payload to all subscriptions' do
-      allow(Pubsubhubbub::DeliveryWorker).to receive(:perform_async)
+      allow(Pubsubhubbub::DeliveryWorker).to receive(:push_bulk)
       subject.perform(status.stream_entry.id)
-      expect(Pubsubhubbub::DeliveryWorker).to have_received(:perform_async).with(subscription_with_follower.id, /.*/)
-      expect(Pubsubhubbub::DeliveryWorker).to have_received(:perform_async).with(anonymous_subscription.id, /.*/)
+      expect(Pubsubhubbub::DeliveryWorker).to have_received(:push_bulk).with([anonymous_subscription, subscription_with_follower])
     end
   end
 
@@ -27,10 +26,10 @@ describe Pubsubhubbub::DistributionWorker do
     let(:status) { Fabricate(:status, account: alice, text: 'Hello', visibility: :private) }
 
     it 'delivers payload only to subscriptions with followers' do
-      allow(Pubsubhubbub::DeliveryWorker).to receive(:perform_async)
+      allow(Pubsubhubbub::DeliveryWorker).to receive(:push_bulk)
       subject.perform(status.stream_entry.id)
-      expect(Pubsubhubbub::DeliveryWorker).to have_received(:perform_async).with(subscription_with_follower.id, /.*/)
-      expect(Pubsubhubbub::DeliveryWorker).to_not have_received(:perform_async).with(anonymous_subscription.id, /.*/)
+      expect(Pubsubhubbub::DeliveryWorker).to have_received(:push_bulk).with([subscription_with_follower])
+      expect(Pubsubhubbub::DeliveryWorker).to_not have_received(:push_bulk).with([anonymous_subscription])
     end
   end
 
@@ -38,9 +37,9 @@ describe Pubsubhubbub::DistributionWorker do
     let(:status) { Fabricate(:status, account: alice, text: 'Hello', visibility: :direct) }
 
     it 'does not deliver payload' do
-      allow(Pubsubhubbub::DeliveryWorker).to receive(:perform_async)
+      allow(Pubsubhubbub::DeliveryWorker).to receive(:push_bulk)
       subject.perform(status.stream_entry.id)
-      expect(Pubsubhubbub::DeliveryWorker).to_not have_received(:perform_async)
+      expect(Pubsubhubbub::DeliveryWorker).to_not have_received(:push_bulk)
     end
   end
 end