aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test
diff options
context:
space:
mode:
authorLuciano Sousa <ls@lucianosousa.net>2018-12-30 18:14:49 -0500
committerGeorge Claghorn <george.claghorn@gmail.com>2018-12-30 18:14:49 -0500
commitc329d323fc2cc9ba1c486932556afd8fbd9333cc (patch)
tree02bb3e552fc4e75792dc0611d0b34be88238261e /activestorage/test
parente7bcbf7b29107d93633746644b1e18e626366934 (diff)
downloadrails-c329d323fc2cc9ba1c486932556afd8fbd9333cc.tar.gz
rails-c329d323fc2cc9ba1c486932556afd8fbd9333cc.tar.bz2
rails-c329d323fc2cc9ba1c486932556afd8fbd9333cc.zip
Permit generating variants of TIFF images
Diffstat (limited to 'activestorage/test')
-rw-r--r--activestorage/test/fixtures/files/racecar.tifbin0 -> 33705838 bytes
-rw-r--r--activestorage/test/models/variant_test.rb11
2 files changed, 11 insertions, 0 deletions
diff --git a/activestorage/test/fixtures/files/racecar.tif b/activestorage/test/fixtures/files/racecar.tif
new file mode 100644
index 0000000000..0a11b22896
--- /dev/null
+++ b/activestorage/test/fixtures/files/racecar.tif
Binary files differ
diff --git a/activestorage/test/models/variant_test.rb b/activestorage/test/models/variant_test.rb
index 012aee3cc9..d98935eb9f 100644
--- a/activestorage/test/models/variant_test.rb
+++ b/activestorage/test/models/variant_test.rb
@@ -133,6 +133,17 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase
assert_equal 20, image.height
end
+ test "resized variation of TIFF blob" do
+ blob = create_file_blob(filename: "racecar.tif")
+ variant = blob.variant(resize: "50x50").processed
+ assert_match(/racecar\.png/, variant.service_url)
+
+ image = read_image(variant)
+ assert_equal "PNG", image.type
+ assert_equal 50, image.width
+ assert_equal 33, image.height
+ end
+
test "optimized variation of GIF blob" do
blob = create_file_blob(filename: "image.gif", content_type: "image/gif")