method

blob

blob(filename:, **attributes)
public

Generate a YAML-encoded representation of an ActiveStorage::Blob instance’s attributes, resolve the file relative to the directory mentioned by ActiveSupport::Testing::FileFixtures.file_fixture, and upload the file to the Service

Examples

# tests/fixtures/active_storage/blobs.yml
second_thumbnail_blob: <%= ActiveStorage::FixtureSet.blob(
  filename: "second.svg",
) %>

third_thumbnail_blob: <%= ActiveStorage::FixtureSet.blob(
  filename: "third.svg",
  content_type: "image/svg+xml",
  service_name: "public"
) %>