Skip to content

FAQ & Troubleshooting

Hadi Nishad edited this page Feb 3, 2016 · 4 revisions

Sidekiq stops processing jobs when using rspec-sidekiq

rspec-sidekiq performs a require "sidekiq/testing" for you, meaning that Sidekiq jobs will not be pushed to Redis but instead to a jobs array to enable testing.

This is not a feature of rspec-sidekiq but of Sidekiq. See https://github.com/mperham/sidekiq/wiki/Testing for more information.


"WARNING! Sidekiq will *NOT* process jobs in this environment" message

What does this mean?

This warning means that Sidekiq jobs will not be enqueued to Redis but instead to a jobs array so that testing can occur.

See Sidekiq stops processing jobs when using rspec-sidekiq for more information.

How do I disable it?

Add the following configuration to your spec_helper.rb file... (In case you have rspec 3 or higher you should add it to rails_helper.rb instead)

RSpec::Sidekiq.configure do |config|
  config.warn_when_jobs_not_processed_by_sidekiq = false
end

How do I disable the terminal colours?

Add the following configuration to your spec_helper.rb file...

RSpec::Sidekiq.configure do |config|
  config.enable_terminal_colours = false
end

"have_enqueued_jobs matcher has been removed from rspec-sidekiq 1.x.x." message

The have_enqueued_jobs matcher has been remove from rspec-sidekiq 1.x.x and up due to a better syntax already being available from RSpec. E.g.

# RSpec 2.x
expect(Job).to have(2).jobs
# or
expect(Job).to have(2).enqueued.jobs

# RSpec 3.x
expect(Job.jobs.size).to eq(2)