class MartenRailsBridge::ActiveStorage::Representations::RedirectHandlerProcessingTest

Overview

A variation nothing has stored is transformed, stored and then served by the same redirect.

The Disk service is used rather than the presigning S3 one, because these cases need a service that really stores what the handler writes and hands back the bytes to measure. :nodoc:

Defined in:

active_storage/representations/redirect_handler_test.cr

Constant Summary

AVATAR_PATH = (Path["/woodpecker/src/codeberg.org/miry/marten-rails-bridge/src/active_storage/representations"].join("../../../examples/demo/src/assets/images/avatar.jpg")).normalize.to_s

The 1600x1200 image the demo serves, committed next to it.

BLOB_KEY = "gz0zdzhk0yn6zjhxfzl6qt1ys5rj"

Instance Method Summary

Instance Method Detail

def setup #

def teardown #

def test_a_cold_tracked_variation_is_processed_and_served #

def test_a_cold_variation_lands_under_the_derived_key_when_track_variants_is_off #

def test_a_missing_processor_backend_is_not_a_404 #

An app that never assigned a backend. The variation is fine, the deployment is not configured.


def test_a_stored_derived_object_is_served_without_writing_a_record #

A tracked app reading a bucket an untracked Rails app wrote: the object is already there, so it is served as it is and no record is written.


def test_an_operation_the_processor_does_not_implement_is_not_a_404 #

An uncaught error is Marten's 500. Rails raises here too, so a transformation the processor cannot run must not read as a missing representation.


def test_returns_404_when_the_source_blob_is_not_stored #

The row is there but its object is not, so processing cannot download the source. A missing source is a missing representation, which is the 404 Rails gives, not a 500.


def test_the_processed_variant_is_reachable #

The served URL points at what was just written, not at a key nothing is stored under.


def test_the_second_request_reuses_the_record #