Skip to content

Commit

Permalink
added Resque.enqueue_with_queue spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeshua Borges authored and defunkt committed Sep 22, 2011
1 parent f2a1e12 commit 57bb576
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/resque_test.rb
Expand Up @@ -136,6 +136,16 @@
assert_equal nil, Resque.reserve(:method)
end

test "can define a queue for jobs by way of a method" do
assert_equal 0, Resque.size(:method)
assert Resque.enqueue_to(:new_queue, SomeMethodJob, 20, '/tmp')

job = Resque.reserve(:new_queue)
assert_equal SomeMethodJob, job.payload_class
assert_equal 20, job.args[0]
assert_equal '/tmp', job.args[1]
end

test "needs to infer a queue with enqueue" do
assert_raises Resque::NoQueueError do
Resque.enqueue(SomeJob, 20, '/tmp')
Expand Down

0 comments on commit 57bb576

Please sign in to comment.