diff options
author | Jeffrey Guenther <guenther.jeffrey@gmail.com> | 2017-11-20 17:01:27 -0800 |
---|---|---|
committer | Jeffrey Guenther <guenther.jeffrey@gmail.com> | 2017-11-20 17:01:27 -0800 |
commit | c73001f4b7b5aae12a64be0c827c14739c0ba124 (patch) | |
tree | 2fff88211b4b88105ac0a78f549d5ca4d46246e1 /activestorage/test/test_helper.rb | |
parent | 686b3466bab78ca69eaab98d76cc489d84d5eb62 (diff) | |
parent | 1d24e47140356f136471d15e3ce3fa427f4430c2 (diff) | |
download | rails-c73001f4b7b5aae12a64be0c827c14739c0ba124.tar.gz rails-c73001f4b7b5aae12a64be0c827c14739c0ba124.tar.bz2 rails-c73001f4b7b5aae12a64be0c827c14739c0ba124.zip |
Merge branch 'master' into activestorage-guide
Diffstat (limited to 'activestorage/test/test_helper.rb')
-rw-r--r-- | activestorage/test/test_helper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activestorage/test/test_helper.rb b/activestorage/test/test_helper.rb index 38408cdad3..aaf1d452ea 100644 --- a/activestorage/test/test_helper.rb +++ b/activestorage/test/test_helper.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +ENV["RAILS_ENV"] ||= "test" require_relative "dummy/config/environment.rb" require "bundler/setup" @@ -45,8 +46,8 @@ class ActiveSupport::TestCase ActiveStorage::Blob.create_after_upload! io: StringIO.new(data), filename: filename, content_type: content_type end - 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 + def create_file_blob(filename: "racecar.jpg", content_type: "image/jpeg", metadata: nil) + ActiveStorage::Blob.create_after_upload! io: file_fixture(filename).open, filename: filename, content_type: content_type, metadata: metadata end def create_blob_before_direct_upload(filename: "hello.txt", byte_size:, checksum:, content_type: "text/plain") |