aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test
diff options
context:
space:
mode:
Diffstat (limited to 'activestorage/test')
-rw-r--r--activestorage/test/fixtures/files/colors.bmpbin0 -> 2810 bytes
-rw-r--r--activestorage/test/models/variant_test.rb11
2 files changed, 11 insertions, 0 deletions
diff --git a/activestorage/test/fixtures/files/colors.bmp b/activestorage/test/fixtures/files/colors.bmp
new file mode 100644
index 0000000000..3cc1e8764d
--- /dev/null
+++ b/activestorage/test/fixtures/files/colors.bmp
Binary files differ
diff --git a/activestorage/test/models/variant_test.rb b/activestorage/test/models/variant_test.rb
index f6fa0e7afa..6b43923159 100644
--- a/activestorage/test/models/variant_test.rb
+++ b/activestorage/test/models/variant_test.rb
@@ -152,6 +152,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")