mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 00:00:46 +08:00
DEV: improve design of site setting default provider
This refactors it so "Defaults provider" is only responsible for "defaults" Locale handling and management of locale settings is moved back into SiteSettingExtension This eliminates complex state management using DistributedCache and makes it way easier to test SiteSettingExtension
This commit is contained in:
@ -505,6 +505,15 @@ describe SiteSettingExtension do
|
||||
end
|
||||
|
||||
describe "shadowed_by_global" do
|
||||
|
||||
context "default_locale" do
|
||||
it "supports adding a default locale via a global" do
|
||||
global_setting :default_locale, 'zh_CN'
|
||||
settings.default_locale = 'en'
|
||||
expect(settings.default_locale).to eq('zh_CN')
|
||||
end
|
||||
end
|
||||
|
||||
context "without global setting" do
|
||||
before do
|
||||
settings.setting(:trout_api_key, 'evil', shadowed_by_global: true)
|
||||
|
Reference in New Issue
Block a user