You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My sidekiq tests with Sidekiq::Testing.fake! were passing until I've added sidekiq-unique-jobs and enabling it in my worker. All other tests are passing except line 19 and 20. Here is my test case :
classMyWorkerincludeSidekiq::Workersidekiq_options:queue=>:working,:retry=>1,:backtrace=>10sidekiq_options:unique=>truesidekiq_retries_exhausteddo |msg|
Sidekiq.logger.warn"Failed #{msg['class']} with #{msg['args']}: #{msg['error_message']}"enddefperform(param)putsparamendend
require"spec_helper"describeMyWorkerdocontext"as a resque worker"doit"reponds to #perform"doMyWorker.new.shouldrespond_to(:perform)endendit{shouldbe_processed_in:working}it{shouldbe_retryable1}it{shouldbe_unique}it"enqueue a job"doparam='work'expect(MyWorker).tohave_enqueued_jobs(0)MyWorker.perform_async(param)expect(MyWorker).tohave_enqueued_jobs(1)expect(MyWorker).tohave_enqueued_job(param)endit"performs a job"doMyWorker.new.perform('chocolate').shouldbe_trueendend
Failures:
1) MyWorker enqueue a job
Failure/Error: expect(MyWorker).to have_enqueued_jobs(1)
expected MyWorker to have 1 enqueued job but got 0
# ./spec/workers/my_worker_spec.rb:19:in `block (2 levels) in <top (required)>'
The text was updated successfully, but these errors were encountered:
My sidekiq tests with
Sidekiq::Testing.fake!
were passing until I've addedsidekiq-unique-jobs
and enabling it in my worker. All other tests are passing except line 19 and 20. Here is my test case :Failures: 1) MyWorker enqueue a job Failure/Error: expect(MyWorker).to have_enqueued_jobs(1) expected MyWorker to have 1 enqueued job but got 0 # ./spec/workers/my_worker_spec.rb:19:in `block (2 levels) in <top (required)>'
The text was updated successfully, but these errors were encountered: