aboutsummaryrefslogtreecommitdiffstats
path: root/test/cases/adapter_test.rb
blob: 703058dacbac71ad2eedb86259dc40a34646b33a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
require 'helper'

class AdapterTest < ActiveSupport::TestCase
  setup    { @old_adapter = ActiveJob::Base.queue_adapter }
  teardown { ActiveJob::Base.queue_adapter = @old_adapter }

  test 'should load inline adapter' do
    ActiveJob::Base.queue_adapter = :inline
    assert_equal ActiveJob::QueueAdapters::InlineAdapter, ActiveJob::Base.queue_adapter
  end

  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
    ActiveJob::Base.queue_adapter = :resque
    assert_equal ActiveJob::QueueAdapters::ResqueAdapter, ActiveJob::Base.queue_adapter
  end

  test 'should load Sidekiq adapter' do
    ActiveJob::Base.queue_adapter = :sidekiq
    assert_equal ActiveJob::QueueAdapters::SidekiqAdapter, ActiveJob::Base.queue_adapter
  end

  test 'should load Sucker Punch adapter' do
    ActiveJob::Base.queue_adapter = :sucker_punch
    assert_equal ActiveJob::QueueAdapters::SuckerPunchAdapter, ActiveJob::Base.queue_adapter
  end

  test 'should load Sneakers adapter' do
    ActiveJob::Base.queue_adapter = :sneakers
    assert_equal ActiveJob::QueueAdapters::SneakersAdapter, ActiveJob::Base.queue_adapter
  end

  test 'should load Backburner adapter' do
    ActiveJob::Base.queue_adapter = :backburner
    assert_equal ActiveJob::QueueAdapters::BackburnerAdapter, ActiveJob::Base.queue_adapter
  end
end