mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 08:09:33 +08:00
FIX: Client settings were not being published.
This commit is contained in:
parent
5120dcfb3d
commit
f2c64a3580
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user