From 311af752cfd98b534a3d5dbf30e4a202693f32dc Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Fri, 15 Dec 2017 10:45:00 -0500 Subject: Restrict variants to variable image blobs --- activestorage/test/models/variant_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activestorage/test') diff --git a/activestorage/test/models/variant_test.rb b/activestorage/test/models/variant_test.rb index b7d20ab55a..83ebce4446 100644 --- a/activestorage/test/models/variant_test.rb +++ b/activestorage/test/models/variant_test.rb @@ -27,6 +27,12 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase assert_match(/Gray/, image.colorspace) end + test "variation of invariable blob" do + assert_raises ActiveStorage::Blob::InvariableError do + create_file_blob(filename: "report.pdf", content_type: "application/pdf").variant(resize: "100x100") + end + end + test "service_url doesn't grow in length despite long variant options" do variant = @blob.variant(font: "a" * 10_000).processed assert_operator variant.service_url.length, :<, 500 -- cgit v1.2.3