aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test
diff options
context:
space:
mode:
authorJavan Makhmali <javan@javan.us>2018-05-23 16:24:08 -0400
committerGitHub <noreply@github.com>2018-05-23 16:24:08 -0400
commit78a9de52ddccefd01af2b88c21450dc29386f029 (patch)
tree41542115dc1294cb89390dad51485f6fcfbbc43a /activestorage/test
parent70bd858af0addd17ea7b7bec4facbad25d3e4c4e (diff)
parentb60ee86d9469e4119cb8900e4bd78a04c86e6f1f (diff)
downloadrails-78a9de52ddccefd01af2b88c21450dc29386f029.tar.gz
rails-78a9de52ddccefd01af2b88c21450dc29386f029.tar.bz2
rails-78a9de52ddccefd01af2b88c21450dc29386f029.zip
Merge pull request #32967 from javan/ast/jpg-video-previews
Change Active Storage’s video preview format from PNG to JPG
Diffstat (limited to 'activestorage/test')
-rw-r--r--activestorage/test/models/preview_test.rb4
-rw-r--r--activestorage/test/previewer/video_previewer_test.rb5
2 files changed, 5 insertions, 4 deletions
diff --git a/activestorage/test/models/preview_test.rb b/activestorage/test/models/preview_test.rb
index 55fdc228c8..e7ae399fb7 100644
--- a/activestorage/test/models/preview_test.rb
+++ b/activestorage/test/models/preview_test.rb
@@ -22,8 +22,8 @@ class ActiveStorage::PreviewTest < ActiveSupport::TestCase
preview = blob.preview(resize: "640x280").processed
assert_predicate preview.image, :attached?
- assert_equal "video.png", preview.image.filename.to_s
- assert_equal "image/png", preview.image.content_type
+ assert_equal "video.jpg", preview.image.filename.to_s
+ assert_equal "image/jpeg", preview.image.content_type
image = read_image(preview.image)
assert_equal 640, image.width
diff --git a/activestorage/test/previewer/video_previewer_test.rb b/activestorage/test/previewer/video_previewer_test.rb
index dba9b0d7e2..9dc350205b 100644
--- a/activestorage/test/previewer/video_previewer_test.rb
+++ b/activestorage/test/previewer/video_previewer_test.rb
@@ -12,12 +12,13 @@ class ActiveStorage::Previewer::VideoPreviewerTest < ActiveSupport::TestCase
test "previewing an MP4 video" do
ActiveStorage::Previewer::VideoPreviewer.new(@blob).preview do |attachable|
- assert_equal "image/png", attachable[:content_type]
- assert_equal "video.png", attachable[:filename]
+ assert_equal "image/jpeg", attachable[:content_type]
+ assert_equal "video.jpg", attachable[:filename]
image = MiniMagick::Image.read(attachable[:io])
assert_equal 640, image.width
assert_equal 480, image.height
+ assert_equal "image/jpeg", image.mime_type
end
end
end