method

attachment

Importance_1
v8.1.1 - Show latest stable - 0 notes - Class: FixtureSet
attachment(fixture_set_name, label, column_type: :integer) public

Fixtures support Action Text attachments as part of their `body` HTML.

### Examples

For example, consider a second `Article` fixture declared in `test/fixtures/articles.yml`:

second:
  title: Another Article

You can attach a mention of `articles(:first)` to `second`‘s `content` by embedding a call to `ActionText::FixtureSet.attachment` in the `body:` value in `test/fixtures/action_text/rich_texts.yml`:

second:
  record: second (Article)
  name: content
  body: <div>Hello, <%= ActionText::FixtureSet.attachment("articles", :first) %></div>
Show source
Register or log in to add new notes.