class ActionText::FixtureSet
def self.attachment(fixture_set_name, label, column_type: :integer)
body:
Hello, <%= ActionText::FixtureSet.attachment("articles", :first) %>
name: content
record: second (Article)
second:
in `test/fixtures/action_text/rich_texts.yml`:
embedding a call to `ActionText::FixtureSet.attachment` in the `body:` value
You can attach a mention of `articles(:first)` to `second`'s `content` by
title: Another Article
second:
`test/fixtures/articles.yml`:
For example, consider a second `Article` fixture declared in
### Examples
Fixtures support Action Text attachments as part of their `body` HTML.
def self.attachment(fixture_set_name, label, column_type: :integer) signed_global_id = ActiveRecord::FixtureSet.signed_global_id fixture_set_name, label, column_type: column_type, for: ActionText::Attachable::LOCATOR_NAME %(<action-text-attachment sgid="#{signed_global_id}"></action-text-attachment>) end