class
ActiveStorage::BlobCreateAndUploadTest
- ActiveStorage::BlobCreateAndUploadTest
- Minitest::Test
- Minitest::Runnable
- Reference
- Object
Overview
.create_and_upload! writes a row and an object, hence a separate test case: it runs against the
Disk service, which needs no object storage.
:nodoc:
Defined in:
active_storage/blob_test.crConstant Summary
-
CONTENT =
"0123456789abcdef"
Instance Method Summary
- #setup
- #teardown
-
#test_create_and_upload_accepts_a_file
The IO an app hands over is the tempfile of an uploaded part, not an
IO::Memory. - #test_create_and_upload_accepts_an_explicit_key
- #test_create_and_upload_deletes_the_row_when_the_upload_fails
- #test_create_and_upload_generates_a_base36_key
- #test_create_and_upload_persists_the_row
-
#test_create_and_upload_rejects_an_io_it_cannot_rewind
An IO the checksum pass cannot rewind is refused, the way Rails refuses one, and the refusal comes before the row so there is nothing to delete.
- #test_create_and_upload_serves_a_binary_type_as_an_attachment
- #test_create_and_upload_serves_an_inline_allowed_type_without_a_forced_disposition
- #test_create_and_upload_stores_the_content_in_the_service
-
#test_create_and_upload_unfurls_a_content_larger_than_one_read
The checksum pass reads the IO a chunk at a time, so a content spanning several reads proves the chunks are fed to the digest in order and none is counted twice.
- #test_create_and_upload_unfurls_the_content
- #test_generate_unique_secure_token_honours_the_passed_length
Instance Method Detail
The IO an app hands over is the tempfile of an uploaded part, not an IO::Memory.
An IO the checksum pass cannot rewind is refused, the way Rails refuses one, and the refusal comes before the row so there is nothing to delete.
The checksum pass reads the IO a chunk at a time, so a content spanning several reads proves the chunks are fed to the digest in order and none is counted twice.