1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00
mperham--sidekiq/test/test_rails.rb
Mike Perham c685d6928c Do not allow Sidekiq::Worker in AJ::Base classes, #2424
It will not work as intended and lead to much sorrow and misery.
2015-07-13 21:55:24 -07:00

23 lines
475 B
Ruby

require_relative 'helper'
require 'sidekiq'
require 'sidekiq/web_helpers'
$HAS_AJ = true
begin
require 'active_job'
rescue
$NO_AJ = false
end
class TestRails < Sidekiq::Test
describe 'ActiveJob' do
it 'does not allow Sidekiq::Worker in AJ::Base classes' do
ex = assert_raises ArgumentError do
c = Class.new(ActiveJob::Base)
c.include Sidekiq::Worker
end
assert_includes ex.message, "cannot include"
end if $HAS_AJ
end
end