Allow selecting image type via Regexp
All checks were successful
continuous-integration/drone/push Build is passing
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user