aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/test_helper.rb
diff options
context:
space:
mode:
authorRyan Davidson <daviryan@aol.com>2018-05-06 16:25:05 +0100
committerRyan Davidson <daviryan@aol.com>2018-05-08 23:01:57 +0100
commit8e98bb7758f081622ab5c4eebf3730cce22ee627 (patch)
tree005431e48933ba96e655a56fabd436bcba442c1a /activestorage/test/test_helper.rb
parent5c7656d9a568fda855e6e558b7e44b1ba51425be (diff)
downloadrails-8e98bb7758f081622ab5c4eebf3730cce22ee627.tar.gz
rails-8e98bb7758f081622ab5c4eebf3730cce22ee627.tar.bz2
rails-8e98bb7758f081622ab5c4eebf3730cce22ee627.zip
Add option to ActiveStorage::Blob to set extract_content_type_from_io
This adds a boolean argument called identify to ActiveStorage::Blob methods #create_after_upload, #build_after_upload and #upload. It allows a user to bypass the automatic content_type inference from the io.
Diffstat (limited to 'activestorage/test/test_helper.rb')
-rw-r--r--activestorage/test/test_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activestorage/test/test_helper.rb b/activestorage/test/test_helper.rb
index 499d955a2f..573a8e0b0b 100644
--- a/activestorage/test/test_helper.rb
+++ b/activestorage/test/test_helper.rb
@@ -50,8 +50,8 @@ class ActiveSupport::TestCase
end
private
- def create_blob(data: "Hello world!", filename: "hello.txt", content_type: "text/plain")
- ActiveStorage::Blob.create_after_upload! io: StringIO.new(data), filename: filename, content_type: content_type
+ def create_blob(data: "Hello world!", filename: "hello.txt", content_type: "text/plain", identify: true)
+ ActiveStorage::Blob.create_after_upload! io: StringIO.new(data), filename: filename, content_type: content_type, identify: identify
end
def create_file_blob(filename: "racecar.jpg", content_type: "image/jpeg", metadata: nil)