mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
DEV: Add more _map extensions for list site settings (#27045)
Following on from eea74e0e32
,
this commit adds the automatic _map splitting shorthand
for emoji_list, tag_list site settings.
This commit is contained in:
parent
e90e6e8f86
commit
d964709644
@ -584,9 +584,9 @@ module SiteSettingExtension
|
||||
end
|
||||
end
|
||||
|
||||
# Same logic as above for group_list settings, with the caveat that normal
|
||||
# Same logic as above for other list type settings, with the caveat that normal
|
||||
# list settings are not necessarily integers, so we just want to handle the splitting.
|
||||
if type_supervisor.get_type(name) == :list
|
||||
if %i[list emoji_list tag_list].include?(type_supervisor.get_type(name))
|
||||
list_type = type_supervisor.get_list_type(name)
|
||||
|
||||
if %w[simple compact].include?(list_type) || list_type.nil?
|
||||
|
@ -906,6 +906,16 @@ RSpec.describe SiteSettingExtension do
|
||||
expect(SiteSetting.respond_to?(:discourse_connect_provider_secrets_map)).to eq(false)
|
||||
end
|
||||
|
||||
it "handles splitting emoji_list settings" do
|
||||
SiteSetting.emoji_deny_list = "smile|frown"
|
||||
expect(SiteSetting.emoji_deny_list_map).to eq(%w[smile frown])
|
||||
end
|
||||
|
||||
it "handles splitting tag_list settings" do
|
||||
SiteSetting.digest_suppress_tags = "blah|blah2"
|
||||
expect(SiteSetting.digest_suppress_tags_map).to eq(%w[blah blah2])
|
||||
end
|
||||
|
||||
it "handles null values for settings" do
|
||||
SiteSetting.ga_universal_auto_link_domains = nil
|
||||
SiteSetting.pm_tags_allowed_for_groups = nil
|
||||
|
Loading…
Reference in New Issue
Block a user