Allow selecting image type via Regexp
All checks were successful
continuous-integration/drone/push Build is passing

For example, SVG images might be of type "image/svg" or "image/svg+xml"
This commit is contained in:
2024-08-14 16:12:28 +02:00
parent 339508bf41
commit 17883b7b6c
2 changed files with 17 additions and 1 deletions

View File

@@ -68,6 +68,16 @@ RSpec.describe Manifique::Metadata do
icon = metadata.select_icon(type: "image/png")
expect(icon["sizes"]).to eq("512x512")
end
it "matches strings exactly" do
icon = metadata.select_icon(type: "image/svg")
expect(icon["type"]).to eq("image/svg")
end
it "works with a regex" do
icon = metadata.select_icon(type: /image\/svg/)
expect(icon["type"]).to eq("image/svg+xml")
end
end
describe "by size" do