Consolidate configuration of Sidekiq::Testing.fake!
setup (#28046)
This commit is contained in:
parent
c810b197ad
commit
973597c6f1
10 changed files with 28 additions and 65 deletions
|
@ -9,13 +9,7 @@ describe Api::V1::Statuses::ReblogsController do
|
|||
let(:app) { Fabricate(:application, name: 'Test app', website: 'http://testapp.com') }
|
||||
let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'write:statuses', application: app) }
|
||||
|
||||
context 'with an oauth token' do
|
||||
around do |example|
|
||||
Sidekiq::Testing.fake! do
|
||||
example.run
|
||||
end
|
||||
end
|
||||
|
||||
context 'with an oauth token', :sidekiq_fake do
|
||||
before do
|
||||
allow(controller).to receive(:doorkeeper_token) { token }
|
||||
end
|
||||
|
|
|
@ -38,12 +38,10 @@ describe Settings::ExportsController do
|
|||
expect(response).to redirect_to(settings_export_path)
|
||||
end
|
||||
|
||||
it 'queues BackupWorker job by 1' do
|
||||
Sidekiq::Testing.fake! do
|
||||
expect do
|
||||
post :create
|
||||
end.to change(BackupWorker.jobs, :size).by(1)
|
||||
end
|
||||
it 'queues BackupWorker job by 1', :sidekiq_fake do
|
||||
expect do
|
||||
post :create
|
||||
end.to change(BackupWorker.jobs, :size).by(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue