Created
May 4, 2020 23:12
-
-
Save seanknox/70e847dac1eaba6d647b187e03fa7bc7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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