mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-09-18 14:32:03 +09:00
Disable libvips unfuzzed operations (#226)
and add test coverage for (un)supported file types. The avatar and logo variants move into the models and return nil for content types that are no longer variable, so the controllers fall back to the initials avatar and stock logo icon instead of raising `ActiveStorage::InvariableError`.
This commit is contained in:
@@ -30,6 +30,13 @@ class Accounts::LogosControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_valid_png_response size: 192
|
||||
end
|
||||
|
||||
test "show stock when custom logo cannot be resized" do
|
||||
accounts(:signal).update! logo: fixture_file_upload("pixel.bmp", "image/bmp")
|
||||
|
||||
get account_logo_url
|
||||
assert_valid_png_response size: 512
|
||||
end
|
||||
|
||||
test "destroy" do
|
||||
accounts(:signal).update! logo: fixture_file_upload("moon.jpg", "image/jpeg")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user