mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +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 = []
|
site_setting_icons = []
|
||||||
|
|
||||||
SiteSetting.settings_hash.select do |key, value|
|
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('|')
|
site_setting_icons |= value.split('|')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -317,7 +317,7 @@ Discourse SVG subset of #{fa_license}
|
||||||
# Theme.all includes default values
|
# Theme.all includes default values
|
||||||
Theme.all.each do |theme|
|
Theme.all.each do |theme|
|
||||||
settings = theme.cached_settings.each do |key, value|
|
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('|')
|
theme_icon_settings |= value.split('|')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -83,6 +83,10 @@ describe SvgSprite do
|
||||||
|
|
||||||
SiteSetting.svg_icon_subset = nil
|
SiteSetting.svg_icon_subset = nil
|
||||||
expect(SvgSprite.all_icons).not_to include("drafting-compass")
|
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
|
end
|
||||||
|
|
||||||
it 'includes icons from plugin registry' do
|
it 'includes icons from plugin registry' do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user