diff options
Diffstat (limited to 'spec/support/sidekiq.rb')
-rw-r--r-- | spec/support/sidekiq.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/support/sidekiq.rb b/spec/support/sidekiq.rb index 575d3451150..d143014692d 100644 --- a/spec/support/sidekiq.rb +++ b/spec/support/sidekiq.rb @@ -3,3 +3,13 @@ require 'sidekiq/testing/inline' Sidekiq::Testing.server_middleware do |chain| chain.add Gitlab::SidekiqStatus::ServerMiddleware end + +RSpec.configure do |config| + config.after(:each, :sidekiq) do + Sidekiq::Worker.clear_all + end + + config.after(:each, :sidekiq, :redis) do + Sidekiq.redis { |redis| redis.flushdb } + end +end |