You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
expect(Person).to have_queued(person.id, :calculate, :job_id => 123) would work, but I have no access to 123 since it's an auto increment.
Any suggestion to work around this? E.g. have_queued_at_least or have_gained_arguments, or have_queued_no_check_value...
Right now, I use Resque.peek to check the job and then do args validation. Making sure I do have a job_id, the number is irrelevant for me as much as testing my arguments have been enriched.
The text was updated successfully, but these errors were encountered:
Those sound like great additions. A PR would be greatly appreciated. Also please take note that in issue #119@pboling is proposing a change to the way have_queued determines what to look at in the queue.
First of al, great gem, super useful, thanks for that.
I have a case where I test if a job can go on the queue or not with before_enqueue and this is the perfect gem for testing that.
That said, in my before_enqueue resque hook, I enrich my arguments.
For example, I create a database entry for error text/status I want to have associated with the job.
So, in the example, this fails:
expect(Person).to have_queued(person.id, :calculate)
Because I added another argument in the queue.
expect(Person).to have_queued(person.id, :calculate, :job_id => 123) would work, but I have no access to 123 since it's an auto increment.
Any suggestion to work around this? E.g. have_queued_at_least or have_gained_arguments, or have_queued_no_check_value...
Right now, I use Resque.peek to check the job and then do args validation. Making sure I do have a job_id, the number is irrelevant for me as much as testing my arguments have been enriched.
The text was updated successfully, but these errors were encountered: