use sidekiq
This commit is contained in:
@@ -9,6 +9,9 @@ require 'rspec/rails'
|
||||
require 'capybara/cuprite'
|
||||
require 'capybara/rspec'
|
||||
require 'webmock/rspec'
|
||||
require 'sidekiq/testing'
|
||||
|
||||
Sidekiq::Testing.fake!
|
||||
|
||||
WebMock.disable_net_connect!(allow_localhost: true)
|
||||
|
||||
@@ -56,4 +59,12 @@ RSpec.configure do |config|
|
||||
driven_by :headless_cuprite
|
||||
end
|
||||
end
|
||||
|
||||
config.before do
|
||||
Sidekiq::Worker.clear_all
|
||||
end
|
||||
|
||||
config.before do |example|
|
||||
Sidekiq::Testing.inline! if example.metadata[:sidekiq] == :inline
|
||||
end
|
||||
end
|
||||
|
||||
@@ -81,7 +81,7 @@ RSpec.describe 'Submit Form' do
|
||||
|
||||
expect do
|
||||
click_on 'submit'
|
||||
end.to change(enqueued_jobs, :size).by(2)
|
||||
end.to change(enqueued_jobs, :size).by(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user