0
0
Fork 0

Combine examples to reduce factories in specs (#33841)

This commit is contained in:
Matt Jankowski 2025-02-06 05:54:31 -05:00 committed by GitHub
parent aff2b11394
commit 23a0d91126
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 10 additions and 42 deletions

View file

@ -33,15 +33,11 @@ RSpec.describe PollExpirationNotifyWorker do
end
context 'when poll is local' do
it 'notifies voters' do
it 'notifies voters, owner, and local voters' do
expect(ActivityPub::DistributePollUpdateWorker).to have_enqueued_sidekiq_job(poll.status.id)
end
it 'notifies owner' do
expect(LocalNotificationWorker).to have_enqueued_sidekiq_job(poll.account.id, poll.id, 'Poll', 'poll')
end
it 'notifies local voters' do
expect(LocalNotificationWorker).to have_enqueued_sidekiq_job(poll_vote.account.id, poll.id, 'Poll', 'poll')
end
end
@ -49,15 +45,11 @@ RSpec.describe PollExpirationNotifyWorker do
context 'when poll is remote' do
let(:remote?) { true }
it 'does not notify remote voters' do
it 'does not notify remote voters or owner, does notify local voters' do
expect(ActivityPub::DistributePollUpdateWorker).to_not have_enqueued_sidekiq_job(poll.status.id)
end
it 'does not notify owner' do
expect(LocalNotificationWorker).to_not have_enqueued_sidekiq_job(poll.account.id, poll.id, 'Poll', 'poll')
end
it 'notifies local voters' do
expect(LocalNotificationWorker).to have_enqueued_sidekiq_job(poll_vote.account.id, poll.id, 'Poll', 'poll')
end
end