mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 06:13:45 +08:00
FIX: Refactor commit a8c3ca, add test
This commit is contained in:
parent
a58c3ca430
commit
ad665b901a
|
@ -287,7 +287,7 @@ Discourse SVG subset of #{fa_license}
|
|||
site_setting_icons = []
|
||||
|
||||
SiteSetting.settings_hash.select do |key, value|
|
||||
if key.to_s.include?("_icon") && value.present? && value.class == String
|
||||
if key.to_s.include?("_icon") && String === value
|
||||
site_setting_icons |= value.split('|')
|
||||
end
|
||||
end
|
||||
|
@ -317,7 +317,7 @@ Discourse SVG subset of #{fa_license}
|
|||
# Theme.all includes default values
|
||||
Theme.all.each do |theme|
|
||||
settings = theme.cached_settings.each do |key, value|
|
||||
if key.to_s.include?("_icon") && value.present? && value.class == String
|
||||
if key.to_s.include?("_icon") && String === value
|
||||
theme_icon_settings |= value.split('|')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -83,6 +83,10 @@ describe SvgSprite do
|
|||
|
||||
SiteSetting.svg_icon_subset = nil
|
||||
expect(SvgSprite.all_icons).not_to include("drafting-compass")
|
||||
|
||||
# does not fail on non-string setting
|
||||
SiteSetting.svg_icon_subset = false
|
||||
expect(SvgSprite.all_icons).to be_truthy
|
||||
end
|
||||
|
||||
it 'includes icons from plugin registry' do
|
||||
|
|
Loading…
Reference in New Issue
Block a user