FIX: Don't use discourse.conf in test

This commit is contained in:
Sam 2015-03-09 12:21:41 +11:00
parent 79a17d5c22
commit da5446a438
1 changed files with 17 additions and 3 deletions

View File

@ -102,15 +102,29 @@ class GlobalSetting
end
end
class BlankProvider < BaseProvider
def lookup(key, default)
default
end
def keys
[]
end
end
class << self
attr_accessor :provider
end
@provider =
FileProvider.from(File.expand_path('../../../config/discourse.conf', __FILE__)) ||
EnvProvider.new
if Rails.env == "test"
@provider = BlankProvider.new
else
@provider =
FileProvider.from(File.expand_path('../../../config/discourse.conf', __FILE__)) ||
EnvProvider.new
end
load_defaults
end