aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/models
diff options
context:
space:
mode:
authorYounes SERRAJ <younes.serraj@gmail.com>2019-04-21 19:07:22 +0200
committerYounes SERRAJ <younes.serraj@gmail.com>2019-04-21 19:07:22 +0200
commitbcf370d689673031073ba2ac5588afe41cc315c9 (patch)
tree7a1a30639368bbcea660424aeae6e694c0a64fdf /activestorage/test/models
parent80b7d58f34a965fc0269ab7e0efa86d39b86be56 (diff)
downloadrails-bcf370d689673031073ba2ac5588afe41cc315c9.tar.gz
rails-bcf370d689673031073ba2ac5588afe41cc315c9.tar.bz2
rails-bcf370d689673031073ba2ac5588afe41cc315c9.zip
Allow ActiveStorage to generate variants of BMP images
Diffstat (limited to 'activestorage/test/models')
-rw-r--r--activestorage/test/models/variant_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/activestorage/test/models/variant_test.rb b/activestorage/test/models/variant_test.rb
index d98935eb9f..92e3384042 100644
--- a/activestorage/test/models/variant_test.rb
+++ b/activestorage/test/models/variant_test.rb
@@ -144,6 +144,17 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase
assert_equal 33, image.height
end
+ test "resized variation of BMP blob" do
+ blob = create_file_blob(filename: "colors.bmp")
+ variant = blob.variant(resize: "15x15").processed
+ assert_match(/colors\.bmp/, variant.service_url)
+
+ image = read_image(variant)
+ assert_equal "BMP", image.type
+ assert_equal 15, image.width
+ assert_equal 8, image.height
+ end
+
test "optimized variation of GIF blob" do
blob = create_file_blob(filename: "image.gif", content_type: "image/gif")