method
attachment
v7.1.3.2 -
Show latest stable
-
0 notes -
Class: FixtureSet
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (38)
- 7.1.3.2 (0)
- What's this?
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>