Skip to content

Instantly share code, notes, and snippets.

@seanknox
Created May 4, 2020 23:12
Show Gist options
  • 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