rspec-sidekiq
rspec-sidekiq copied to clipboard
`has_enqueued_sidekiq_job?` matcher not defined?
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 I had the same problem. I updated the gem to the last version (3.0.1) and it worked.
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
I think this was fixed a while back. If you still see issues on the latest prerelease LMK.