aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/test_helper.rb
diff options
context:
space:
mode:
authorGeorge Claghorn <george.claghorn@gmail.com>2017-09-28 16:43:37 -0400
committerGitHub <noreply@github.com>2017-09-28 16:43:37 -0400
commitd30586211b41e018869a1a3f4e3af778a31591db (patch)
tree664028edf779b3a6d55e08c2503cfe91e2309eff /activestorage/test/test_helper.rb
parentf7b4be40410432b77e0c5d114b0ce73480ff984d (diff)
downloadrails-d30586211b41e018869a1a3f4e3af778a31591db.tar.gz
rails-d30586211b41e018869a1a3f4e3af778a31591db.tar.bz2
rails-d30586211b41e018869a1a3f4e3af778a31591db.zip
Preview PDFs and videos
Diffstat (limited to 'activestorage/test/test_helper.rb')
-rw-r--r--activestorage/test/test_helper.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/activestorage/test/test_helper.rb b/activestorage/test/test_helper.rb
index 2a969fa326..dd37239060 100644
--- a/activestorage/test/test_helper.rb
+++ b/activestorage/test/test_helper.rb
@@ -6,6 +6,7 @@ require "bundler/setup"
require "active_support"
require "active_support/test_case"
require "active_support/testing/autorun"
+require "mini_magick"
begin
require "byebug"
@@ -44,7 +45,7 @@ class ActiveSupport::TestCase
ActiveStorage::Blob.create_after_upload! io: StringIO.new(data), filename: filename, content_type: content_type
end
- def create_image_blob(filename: "racecar.jpg", content_type: "image/jpeg")
+ def create_file_blob(filename: "racecar.jpg", content_type: "image/jpeg")
ActiveStorage::Blob.create_after_upload! \
io: file_fixture(filename).open,
filename: filename, content_type: content_type
@@ -54,8 +55,8 @@ class ActiveSupport::TestCase
ActiveStorage::Blob.create_before_direct_upload! filename: filename, byte_size: byte_size, checksum: checksum, content_type: content_type
end
- def read_image_variant(variant)
- MiniMagick::Image.open variant.service.send(:path_for, variant.key)
+ def read_image(blob_or_variant)
+ MiniMagick::Image.open blob_or_variant.service.send(:path_for, blob_or_variant.key)
end
end