FIX: Client settings were not being published.

This commit is contained in:
Guo Xiang Tan 2016-02-11 11:16:09 +08:00
parent 5120dcfb3d
commit f2c64a3580
2 changed files with 13 additions and 2 deletions

View File

@ -151,7 +151,7 @@ module SiteSettingExtension
# just like a setting, except that it is available in javascript via DiscourseSession
def client_setting(name, default = nil, opts = {})
setting(name, default, opts)
client_settings << name
client_settings << name.to_sym
end
def settings_hash

View File

@ -19,7 +19,7 @@ describe SiteSettingExtension do
end
end
end
let :provider_local do
SiteSettings::LocalProcessProvider.new
end
@ -140,6 +140,17 @@ describe SiteSettingExtension do
settings.set("test_setting", 12)
expect(settings.test_setting).to eq(12)
end
it "should publish changes to clients" do
settings.setting("test_setting", 100)
settings.client_setting("test_setting")
messages = MessageBus.track_publish do
settings.test_setting = 88
end
expect(messages.map(&:channel).include?('/client_settings')).to eq(true)
end
end
end