2014-05-18 16:59:12 -04:00
|
|
|
require 'helper'
|
|
|
|
|
|
|
|
class AdapterTest < ActiveSupport::TestCase
|
2014-05-20 06:22:20 -04:00
|
|
|
setup { @old_adapter = ActiveJob::Base.queue_adapter }
|
|
|
|
teardown { ActiveJob::Base.queue_adapter = @old_adapter }
|
2014-05-18 16:59:12 -04:00
|
|
|
|
|
|
|
test 'should load inline adapter' do
|
2014-05-19 04:55:57 -04:00
|
|
|
ActiveJob::Base.queue_adapter = :inline
|
2014-05-18 16:59:12 -04:00
|
|
|
assert_equal ActiveJob::QueueAdapters::InlineAdapter, ActiveJob::Base.queue_adapter
|
|
|
|
end
|
|
|
|
|
2014-05-19 14:09:45 -04:00
|
|
|
test 'should load Delayed Job adapter' do
|
|
|
|
ActiveJob::Base.queue_adapter = :delayed_job
|
|
|
|
assert_equal ActiveJob::QueueAdapters::DelayedJobAdapter, ActiveJob::Base.queue_adapter
|
|
|
|
end
|
|
|
|
|
|
|
|
test 'should load Que adapter' do
|
|
|
|
ActiveJob::Base.queue_adapter = :que
|
|
|
|
assert_equal ActiveJob::QueueAdapters::QueAdapter, ActiveJob::Base.queue_adapter
|
|
|
|
end
|
|
|
|
|
|
|
|
test 'should load Queue Classic adapter' do
|
|
|
|
ActiveJob::Base.queue_adapter = :queue_classic
|
|
|
|
assert_equal ActiveJob::QueueAdapters::QueueClassicAdapter, ActiveJob::Base.queue_adapter
|
|
|
|
end
|
|
|
|
|
|
|
|
test 'should load Resque adapter' do
|
2014-05-19 04:55:57 -04:00
|
|
|
ActiveJob::Base.queue_adapter = :resque
|
2014-05-18 16:59:12 -04:00
|
|
|
assert_equal ActiveJob::QueueAdapters::ResqueAdapter, ActiveJob::Base.queue_adapter
|
|
|
|
end
|
|
|
|
|
2014-05-19 14:09:45 -04:00
|
|
|
test 'should load Sidekiq adapter' do
|
2014-05-19 04:55:57 -04:00
|
|
|
ActiveJob::Base.queue_adapter = :sidekiq
|
2014-05-18 16:59:12 -04:00
|
|
|
assert_equal ActiveJob::QueueAdapters::SidekiqAdapter, ActiveJob::Base.queue_adapter
|
|
|
|
end
|
|
|
|
|
2014-05-19 14:09:45 -04:00
|
|
|
test 'should load Sucker Punch adapter' do
|
2014-05-19 04:55:57 -04:00
|
|
|
ActiveJob::Base.queue_adapter = :sucker_punch
|
2014-05-18 16:59:12 -04:00
|
|
|
assert_equal ActiveJob::QueueAdapters::SuckerPunchAdapter, ActiveJob::Base.queue_adapter
|
|
|
|
end
|
|
|
|
|
2014-05-20 06:22:20 -04:00
|
|
|
test 'should load Sneakers adapter' do
|
|
|
|
ActiveJob::Base.queue_adapter = :sneakers
|
|
|
|
assert_equal ActiveJob::QueueAdapters::SneakersAdapter, ActiveJob::Base.queue_adapter
|
2014-05-18 16:59:12 -04:00
|
|
|
end
|
2014-05-20 07:03:46 -04:00
|
|
|
|
|
|
|
test 'should load Backburner adapter' do
|
|
|
|
ActiveJob::Base.queue_adapter = :backburner
|
|
|
|
assert_equal ActiveJob::QueueAdapters::BackburnerAdapter, ActiveJob::Base.queue_adapter
|
|
|
|
end
|
2014-05-18 16:59:12 -04:00
|
|
|
end
|