diff options
author | George Claghorn <george@basecamp.com> | 2017-12-15 10:45:00 -0500 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2017-12-15 10:45:00 -0500 |
commit | 311af752cfd98b534a3d5dbf30e4a202693f32dc (patch) | |
tree | 16a88bee1a4ea197bc61bdcb449acd28f1b82b3e /activestorage/test/models | |
parent | 3ddb811acc75292776c39f5a95840b21b32d9fd8 (diff) | |
download | rails-311af752cfd98b534a3d5dbf30e4a202693f32dc.tar.gz rails-311af752cfd98b534a3d5dbf30e4a202693f32dc.tar.bz2 rails-311af752cfd98b534a3d5dbf30e4a202693f32dc.zip |
Restrict variants to variable image blobs
Diffstat (limited to 'activestorage/test/models')
-rw-r--r-- | activestorage/test/models/variant_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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 |