0
0
Fork 0

Use Sidekiq fake! instead of inline! in specs (#25369)

This commit is contained in:
Matt Jankowski 2024-01-10 06:06:58 -05:00 committed by GitHub
parent ea1c0feb86
commit 00341c70ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 66 additions and 76 deletions

View file

@ -14,7 +14,7 @@ describe BackupWorker do
let(:backup) { Fabricate(:backup) }
let!(:other_backup) { Fabricate(:backup, user: backup.user) }
it 'sends the backup to the service and removes other backups' do
it 'sends the backup to the service and removes other backups', :sidekiq_inline do
expect do
worker.perform(backup.id)
end.to change(UserMailer.deliveries, :size).by(1)

View file

@ -104,7 +104,7 @@ describe MoveWorker do
end
shared_examples 'lists handling' do
it 'puts the new account on the list and makes valid lists', sidekiq: :inline do
it 'puts the new account on the list and makes valid lists', :sidekiq_inline do
subject.perform(source_account.id, target_account.id)
expect(list.accounts.include?(target_account)).to be true
@ -159,7 +159,7 @@ describe MoveWorker do
describe '#perform' do
context 'when both accounts are distant' do
it 'calls UnfollowFollowWorker', :sidekiq_fake do
it 'calls UnfollowFollowWorker' do
subject.perform(source_account.id, target_account.id)
expect(UnfollowFollowWorker).to have_enqueued_sidekiq_job(local_follower.id, source_account.id, target_account.id, false)
end
@ -170,7 +170,7 @@ describe MoveWorker do
context 'when target account is local' do
let(:target_account) { Fabricate(:account) }
it 'calls UnfollowFollowWorker', :sidekiq_fake do
it 'calls UnfollowFollowWorker' do
subject.perform(source_account.id, target_account.id)
expect(UnfollowFollowWorker).to have_enqueued_sidekiq_job(local_follower.id, source_account.id, target_account.id, true)
end

View file

@ -10,7 +10,7 @@ describe PollExpirationNotifyWorker do
let(:remote?) { false }
let(:poll_vote) { Fabricate(:poll_vote, poll: poll) }
describe '#perform', :sidekiq_fake do
describe '#perform' do
it 'runs without error for missing record' do
expect { worker.perform(nil) }.to_not raise_error
end