1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activejob/test/support/integration/adapters/delayed_job.rb
Matthew Draper d7a058f785 Make AJ integration tests much less verbose
In passing, avoid a blind retry in QC: instead, just fix the problem.
2014-09-27 21:59:10 +09:30

20 lines
419 B
Ruby

require 'delayed_job'
require 'delayed_job_active_record'
module DelayedJobJobsManager
def setup
ActiveJob::Base.queue_adapter = :delayed_job
end
def clear_jobs
Delayed::Job.delete_all
end
def start_workers
@worker = Delayed::Worker.new(quiet: true, sleep_delay: 0.5, queues: %w(integration_tests))
@thread = Thread.new { @worker.start }
end
def stop_workers
@worker.stop
end
end