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

`has_enqueued_sidekiq_job?` matcher not defined?

Open mecampbellsoup opened this issue 8 years ago • 2 comments

spec/lib/otx/processors/ach_spec.rb|16 error|  Failure/Error: expect(AchTransactionProcessingJob).to have_enqueued_sidekiq_job(transaction.id) expected AchTransactionProcessingJob to respond to `has_enqueued_sidekiq_job?`

Code:

      def process
        if @transaction.transaction_type == "credit"
          AchTransactionProcessingJob.perform_async(@transaction.id)

Assertion:

      it "enqueues an AchTransactionProcessingJob" do
        subject
        expect(AchTransactionProcessingJob).to have_enqueued_sidekiq_job(transaction.id)
      end

Gemfile:

group :test do
  gem 'rspec-sidekiq'

Gemfile.lock:

    rspec-sidekiq (2.2.0)

mecampbellsoup avatar May 25 '17 19:05 mecampbellsoup

@mecampbellsoup I had the same problem. I updated the gem to the last version (3.0.1) and it worked.

jsuarezb avatar Jun 12 '17 20:06 jsuarezb

Having the same problem in 3.0.2 Had to browse through the issues to find the configuration first of all needs to be inside the rails_helper.rb, but still can't get this work properly

coding-red-panda avatar Oct 18 '18 07:10 coding-red-panda

I think this was fixed a while back. If you still see issues on the latest prerelease LMK.

wspurgin avatar Aug 11 '23 19:08 wspurgin