Commit 3bf1cd57 authored by Rémy Coutable's avatar Rémy Coutable

Ensure in-memory application settings are cleared before each test

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent a5517ada
...@@ -13,6 +13,10 @@ module Gitlab ...@@ -13,6 +13,10 @@ module Gitlab
Gitlab::FakeApplicationSettings.new(::ApplicationSetting.defaults.merge(attributes || {})) Gitlab::FakeApplicationSettings.new(::ApplicationSetting.defaults.merge(attributes || {}))
end end
def clear_in_memory_application_settings!
instance_variable_set(:@in_memory_application_settings, nil)
end
def method_missing(name, *args, &block) def method_missing(name, *args, &block)
current_application_settings.send(name, *args, &block) # rubocop:disable GitlabSecurity/PublicSend current_application_settings.send(name, *args, &block) # rubocop:disable GitlabSecurity/PublicSend
end end
......
...@@ -135,6 +135,10 @@ RSpec.configure do |config| ...@@ -135,6 +135,10 @@ RSpec.configure do |config|
Fog.unmock! if Fog.mock? Fog.unmock! if Fog.mock?
end end
config.after(:example) do
Gitlab::CurrentSettings.clear_in_memory_application_settings!
end
config.before(:example, :mailer) do config.before(:example, :mailer) do
reset_delivered_emails! reset_delivered_emails!
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment