Skip to content

Instantly share code, notes, and snippets.

@RadoMark
Last active August 29, 2015 14:26
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 RadoMark/346875f5b18ca817778b to your computer and use it in GitHub Desktop.
Save RadoMark/346875f5b18ca817778b to your computer and use it in GitHub Desktop.
# RSpec configuration
RSpec.configure do |config|
config.around(:each) do |example|
Sidekiq::Testing.inline!(&example)
end
config.around(:each, sidekiq: :fake) do |example|
Sidekiq::Testing.fake!(&example)
end
config.around(:each, sidekiq: :disable) do |example|
Sidekiq::Testing.disable!(&example)
end
end
# Specs
it 'queues sidekiq worker', sidekiq: :fake do
# THE code called with Sidekiq::Testing.fake!(&example) around
end
it 'queues sidekiq worker', sidekiq: :disable do
# THE codec called with Sidekiq::Testing.disable!(&example) around
end
it 'queues sidekiq worker' do
# THE code called with Sidekiq::Testing.inline!(&example) around
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment