about summary refs log tree commit diff
path: root/spec/rails_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rails_helper.rb')
-rw-r--r--spec/rails_helper.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index cfc9eec9e..9a4c8fd3c 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -13,6 +13,7 @@ Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
 
 ActiveRecord::Migration.maintain_test_schema!
 WebMock.disable_net_connect!
+Redis.current = Redis::Namespace.new("mastodon_test#{ENV['TEST_ENV_NUMBER']}", redis: Redis.current)
 Sidekiq::Testing.inline!
 Sidekiq::Logging.logger = nil
 
@@ -43,6 +44,11 @@ RSpec.configure do |config|
     https = ENV['LOCAL_HTTPS'] == 'true'
     Capybara.app_host = "http#{https ? 's' : ''}://#{ENV.fetch('LOCAL_DOMAIN')}"
   end
+
+  config.after :each do
+    keys = Redis.current.keys
+    Redis.current.del(keys) if keys.any?
+  end
 end
 
 RSpec::Sidekiq.configure do |config|