mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 07:38:06 +08:00
FIX: Issues with custom icons in themes (#13732)
Fixes two issues: - ignores invalid XML in custom icon sprite SVG file (and outputs an error if sprite was uploaded via admin UI) - clears SVG sprite cache when deleting an `icons-sprite` upload in a theme
This commit is contained in:
@ -419,6 +419,17 @@ HTML
|
||||
theme_field.update(upload: Fabricate(:upload))
|
||||
expect(theme_field.value_baked).to eq(nil)
|
||||
end
|
||||
|
||||
it "clears SVG sprite cache when upload is deleted" do
|
||||
fname = "custom-theme-icon-sprite.svg"
|
||||
sprite = UploadCreator.new(file_from_fixtures(fname), fname, for_theme: true).create_for(-1)
|
||||
|
||||
theme_field.update(upload: sprite)
|
||||
expect(SvgSprite.custom_svg_sprites(theme.id).size).to eq(1)
|
||||
|
||||
theme_field.destroy!
|
||||
expect(SvgSprite.custom_svg_sprites(theme.id).size).to eq(0)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user