From 921b877c2fd51cc0abdcf0ef6ca3528808047056 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Tue, 2 Jan 2018 07:19:39 -0500 Subject: Restore support for the -layers transformation --- activestorage/test/fixtures/files/image.gif | Bin 0 -> 2032 bytes activestorage/test/models/variant_test.rb | 8 ++++++++ 2 files changed, 8 insertions(+) create mode 100644 activestorage/test/fixtures/files/image.gif (limited to 'activestorage/test') diff --git a/activestorage/test/fixtures/files/image.gif b/activestorage/test/fixtures/files/image.gif new file mode 100644 index 0000000000..90c05f671c Binary files /dev/null and b/activestorage/test/fixtures/files/image.gif differ diff --git a/activestorage/test/models/variant_test.rb b/activestorage/test/models/variant_test.rb index 2a96dfb142..7157bfac3a 100644 --- a/activestorage/test/models/variant_test.rb +++ b/activestorage/test/models/variant_test.rb @@ -50,6 +50,14 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase assert_equal 20, image.height end + test "optimized variation of GIF blob" do + blob = create_file_blob(filename: "image.gif", content_type: "image/gif") + + assert_nothing_raised do + blob.variant(layers: "Optimize").processed + end + 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") -- cgit v1.2.3