Skip to content

Would love if have_queued was not so strict #121

@jchatel

Description

@jchatel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions