method

assert_enqueued_with

Importance_1
v5.1.7 - Show latest stable - 0 notes - Class: TestHelper
assert_enqueued_with(job: nil, args: nil, at: nil, queue: nil) public

Asserts that the job passed in the block has been enqueued with the given arguments.

def test_assert_enqueued_with
  assert_enqueued_with(job: MyJob, args: [1,2,3], queue: 'low') do
    MyJob.perform_later(1,2,3)
  end

  assert_enqueued_with(job: MyJob, at: Date.tomorrow.noon) do
    MyJob.set(wait_until: Date.tomorrow.noon).perform_later
  end
end
Show source
Register or log in to add new notes.