diff options
author | George Claghorn <george@basecamp.com> | 2019-04-21 16:05:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-21 16:05:33 -0400 |
commit | 142a8b97ef4619cb991666fec86db5d387443ffc (patch) | |
tree | 5021e3d0ab4c481653c65e6099d2e620de5d8b12 /activestorage/test | |
parent | 56ffb2654391fc5e312723a1c3c6d58a21016500 (diff) | |
parent | bcf370d689673031073ba2ac5588afe41cc315c9 (diff) | |
download | rails-142a8b97ef4619cb991666fec86db5d387443ffc.tar.gz rails-142a8b97ef4619cb991666fec86db5d387443ffc.tar.bz2 rails-142a8b97ef4619cb991666fec86db5d387443ffc.zip |
Merge pull request #36051 from yoones/active-storage-bmp-variants-support
Allow ActiveStorage to generate variants of BMP images
Diffstat (limited to 'activestorage/test')
-rw-r--r-- | activestorage/test/fixtures/files/colors.bmp | bin | 0 -> 2810 bytes | |||
-rw-r--r-- | activestorage/test/models/variant_test.rb | 11 |
2 files changed, 11 insertions, 0 deletions
diff --git a/activestorage/test/fixtures/files/colors.bmp b/activestorage/test/fixtures/files/colors.bmp Binary files differnew file mode 100644 index 0000000000..3cc1e8764d --- /dev/null +++ b/activestorage/test/fixtures/files/colors.bmp 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") |