rspec-sidekiq icon indicating copy to clipboard operation
rspec-sidekiq copied to clipboard

have_enqueued_job wrong number of arguments (3 for 0..1)

Open typeoneerror opened this issue 9 years ago • 3 comments

I get this error when I try to use this API. I'm afraid I'm using it incorrectly.

UnlockContentJob.perform_later(1, 2, 3)
expect(UnlockContentJob).to have_enqueued_job(1, 2, 3)
Failure/Error: expect(UnlockContentJob).to have_enqueued_job(1, 2, 3)

 ArgumentError:
   wrong number of arguments (3 for 0..1)

The docs show multiple args:

expect(AwesomeJob).to have_enqueued_job('Awesome', true)

UnlockContentJob is an ActiveJob subclass. Could that be why? Do I need to do something special to set up this gem for ActiveJob? It looked like the adapter was set by the gem.

typeoneerror avatar Dec 18 '15 02:12 typeoneerror

Seems like https://github.com/philostler/rspec-sidekiq/issues/83 might be the culprit.

typeoneerror avatar Dec 18 '15 02:12 typeoneerror

If you're using ActiveJob you don't need this gem at all with the latest version of RSpec.

JonRowe avatar Jan 19 '16 23:01 JonRowe

When using methods like retryable? from rspec-sidekiq, you can not dump the Gem, since the latest version of RSpec does not implement those methods..

mathiasjakobsen avatar Jul 08 '16 09:07 mathiasjakobsen

Closed with #199 for good.

wspurgin avatar Aug 11 '23 19:08 wspurgin