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

have_enqueued_sidekiq_job doesn't check order of arguments given to Job

Open shifakhan opened this issue 8 years ago • 1 comments

Code AwesomeJob.perform_async 'Awesome', true

Tests - expect(AwesomeJob).to have_enqueued_sidekiq_job('Awesome', true) expect(AwesomeJob).to have_enqueued_sidekiq_job(true, 'Awesome')

Both tests pass. Is this expected behaviour ? Shouldn't we check the order of the arguments as well?

shifakhan avatar Sep 06 '17 08:09 shifakhan

Got the same problem by passing custom matcher. This is the reason: https://github.com/philostler/rspec-sidekiq/blob/develop/lib/rspec/sidekiq/matchers/have_enqueued_job.rb#L84

jughead avatar Dec 26 '17 16:12 jughead

Oof yeah this is a nasty one since we use ContainsExactly which doesn't care about the order. I'll fix it for the V4 release

wspurgin avatar Aug 01 '23 15:08 wspurgin