1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Merge pull request #452 from sj26/stringify-extensions-proxy-options

Stringify Extensions::Proxy options
This commit is contained in:
Mike Perham 2012-10-17 21:20:17 -07:00
commit cbab748657
2 changed files with 10 additions and 2 deletions

View file

@ -68,8 +68,8 @@ module Sidekiq
hash hash
end end
def client_push(*args) # :nodoc: def client_push(item) # :nodoc:
Sidekiq::Client.push(*args) Sidekiq::Client.push(stringify_keys(item))
end end
end end

View file

@ -29,6 +29,14 @@ class TestExtensions < MiniTest::Unit::TestCase
assert_equal 1, Sidekiq.redis {|c| c.llen('queue:default') } assert_equal 1, Sidekiq.redis {|c| c.llen('queue:default') }
end end
it 'uses and stringifies specified options' do
assert_equal [], Sidekiq::Client.registered_queues
assert_equal 0, Sidekiq.redis {|c| c.llen('queue:notdefault') }
MyModel.delay(queue: :notdefault).long_class_method
assert_equal ['notdefault'], Sidekiq::Client.registered_queues
assert_equal 1, Sidekiq.redis {|c| c.llen('queue:notdefault') }
end
it 'allows delayed scheduling of AR class methods' do it 'allows delayed scheduling of AR class methods' do
assert_equal 0, Sidekiq.redis {|c| c.zcard('schedule') } assert_equal 0, Sidekiq.redis {|c| c.zcard('schedule') }
MyModel.delay_for(5.days).long_class_method MyModel.delay_for(5.days).long_class_method