class
ActiveStorage::Service::S3ServiceReadTest
- ActiveStorage::Service::S3ServiceReadTest
- Minitest::Test
- Minitest::Runnable
- Reference
- Object
Overview
The read side of the same service. The content is stored with the Awscr::S3 client rather than
with #upload, so a read is not asserted through the write that set it up.
:nodoc:
Defined in:
active_storage/service/s3_service_test.crConstant Summary
-
ACCESS_KEY_ID =
"admin" -
BUCKET =
"storage" -
CONTENT =
"0123456789abcdef" -
ENDPOINT =
ENV.fetch("S3_ENDPOINT", "http://127.0.0.1:9000") -
REGION =
"us-east-1" -
SECRET_ACCESS_KEY =
"password"
Instance Method Summary
- #setup
- #teardown
- #test_download_chunk_raises_when_nothing_is_stored_for_the_key
- #test_download_chunk_returns_a_range_ending_at_the_last_byte
- #test_download_chunk_returns_the_inclusive_byte_range
- #test_download_raises_when_nothing_is_stored_for_the_key
- #test_download_returns_the_whole_content
-
#test_download_yields_the_content_in_chunks
The content crosses the chunk boundary, so the block form issues more than one ranged read.
- #test_exist_is_false_after_a_delete
- #test_exist_is_false_for_a_key_nothing_was_stored_under
- #test_exist_is_true_only_once_the_object_is_stored
-
#test_storing_a_key_again_replaces_the_object
A shorter content replacing a longer one: the whole object goes, so no byte of the old one is left past the end of the new.
Instance Method Detail
def test_download_yields_the_content_in_chunks
#
The content crosses the chunk boundary, so the block form issues more than one ranged read. The bytes differ on either side of the boundary, so a repeated or reordered chunk does not pass.
def test_storing_a_key_again_replaces_the_object
#
A shorter content replacing a longer one: the whole object goes, so no byte of the old one is left past the end of the new.