This allows me to do something like this in tests:
Backburner.test_mode = :fake
do_something_that_enqueues_something
assert_not_nil Backburner.test_enqeueued_jobs_find_by_job("FooJob")
If you want the jobs to execute inline instantly instead of going to queue you can do
Backburner.test_mode = :inline
do_something_that_enqueues_something
#the job was executed like SomethingJob.perform(args)
#without going to the queue
That code could easily be extracted to a gem you require in test_helper.
Hi,
I added a
test_enqueued_jobs_find_by_job_and_argument
method which would test whether a job is enqueued based on both job name and argument. Similar to the activejob matcherIt would be great if you can add this to the gist