vidpush/spec/support/background_jobs.rb
2014-04-07 14:41:34 -04:00

20 lines
405 B
Ruby

module BackgroundJobs
def run_background_jobs_immediately
delay_jobs = Delayed::Worker.delay_jobs
Delayed::Worker.delay_jobs = false
yield
ensure
Delayed::Worker.delay_jobs = delay_jobs
end
end
RSpec.configure do |config|
config.around(:each, type: :feature) do |example|
run_background_jobs_immediately do
example.run
end
end
config.include BackgroundJobs
end