mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:21:18 +08:00
DEV: Add auto _map extensions for list site settings with no type (#23331)
Followup to eea74e0e32f704f0756202c3f3ae801bcc8ac8bb. Site settings which are a list without a list_type should also have the _map extension added which returns an array based on split("|"). For example: ``` SiteSetting.post_menu_map => ["read", "like"] ```
This commit is contained in:
@ -870,6 +870,11 @@ RSpec.describe SiteSettingExtension do
|
||||
expect(SiteSetting.ga_universal_auto_link_domains_map).to eq(%w[test.com xy.com])
|
||||
end
|
||||
|
||||
it "handles splitting list settings with no type" do
|
||||
SiteSetting.post_menu = "read|like"
|
||||
expect(SiteSetting.post_menu_map).to eq(%w[read like])
|
||||
end
|
||||
|
||||
it "does not handle splitting secret list settings" do
|
||||
SiteSetting.discourse_connect_provider_secrets = "test|secret1\ntest2|secret2"
|
||||
expect(SiteSetting.respond_to?(:discourse_connect_provider_secrets_map)).to eq(false)
|
||||
|
Reference in New Issue
Block a user