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
Gitlab::FakeApplicationSettings.new(::ApplicationSetting.defaults.merge(attributes || {}))
end
def clear_in_memory_application_settings!
instance_variable_set(:@in_memory_application_settings, nil)
end
def method_missing(name, *args, &block)
current_application_settings.send(name, *args, &block) # rubocop:disable GitlabSecurity/PublicSend
end
......
......@@ -135,6 +135,10 @@ RSpec.configure do |config|
Fog.unmock! if Fog.mock?
end
config.after(:example) do
Gitlab::CurrentSettings.clear_in_memory_application_settings!
end
config.before(:example, :mailer) do
reset_delivered_emails!
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