Question

I am using Sidekiq for background jobs.

I want to run background jobs in Test environment to test some features.

I have read the wiki of sidekiq https://github.com/mperham/sidekiq/wiki/Testing#testing-workers-inline

So I am trying to use that in my spec file but gives me error like

<top (required)>': uninitialized constant Sidekiq::Testing (NameError)

Can anyone help me ?

Thanks

Was it helpful?

Solution

I got It.

Just need to use require 'sidekiq/testing/inline' in spec_helper.rb

Thats it. No need to write Sidekiq::Testing.inline!

OTHER TIPS

Use updated Sidekiq gem version which is compatible with the Rails and ruby versions installed,

gem 'sidekiq', '~> 3.0.0'

Hope it helps :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top