Skip to content

Instantly share code, notes, and snippets.

@seanknox
Created May 4, 2020 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanknox/70e847dac1eaba6d647b187e03fa7bc7 to your computer and use it in GitHub Desktop.
Save seanknox/70e847dac1eaba6d647b187e03fa7bc7 to your computer and use it in GitHub Desktop.
# More about Sidekiq testing modes:
# https://github.com/mperham/sidekiq/wiki/Testing
require 'sidekiq/testing'
RSpec.configure do |config|
config.before(:example) do |example|
Sidekiq::Worker.clear_all
if example.metadata[:sidekiq] == :fake
Sidekiq::Testing.fake!
elsif example.metadata[:sidekiq] == :inline
Sidekiq::Testing.inline!
elsif example.metadata[:type] == :feature
Sidekiq::Testing.inline!
else
Sidekiq::Testing.fake!
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment