mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Consolidate configuration of Sidekiq::Testing.fake! setup (#28046)
This commit is contained in:
@@ -159,12 +159,9 @@ describe MoveWorker do
|
||||
|
||||
describe '#perform' do
|
||||
context 'when both accounts are distant' do
|
||||
it 'calls UnfollowFollowWorker' do
|
||||
Sidekiq::Testing.fake! 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)
|
||||
Sidekiq::Worker.drain_all
|
||||
end
|
||||
it 'calls UnfollowFollowWorker', :sidekiq_fake 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
|
||||
|
||||
include_examples 'common tests'
|
||||
@@ -173,12 +170,9 @@ describe MoveWorker do
|
||||
context 'when target account is local' do
|
||||
let(:target_account) { Fabricate(:account) }
|
||||
|
||||
it 'calls UnfollowFollowWorker' do
|
||||
Sidekiq::Testing.fake! 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)
|
||||
Sidekiq::Worker.clear_all
|
||||
end
|
||||
it 'calls UnfollowFollowWorker', :sidekiq_fake 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
|
||||
|
||||
include_examples 'common tests'
|
||||
|
||||
@@ -10,13 +10,7 @@ describe PollExpirationNotifyWorker do
|
||||
let(:remote?) { false }
|
||||
let(:poll_vote) { Fabricate(:poll_vote, poll: poll) }
|
||||
|
||||
describe '#perform' do
|
||||
around do |example|
|
||||
Sidekiq::Testing.fake! do
|
||||
example.run
|
||||
end
|
||||
end
|
||||
|
||||
describe '#perform', :sidekiq_fake do
|
||||
it 'runs without error for missing record' do
|
||||
expect { worker.perform(nil) }.to_not raise_error
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user