Merge pull request #4007 from tgxworld/fix_siitesetting_not_published_to_clients
FIX: Client settings were not being published.
This commit is contained in:
commit
75a78e0518
|
@ -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