- 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 (-1)
- 7.1.3.4 (0)
- What's this?
Action Text FixtureSet
Fixtures are a way of organizing data that you want to test against; in short, sample data.
To learn more about fixtures, read the ActiveRecord::FixtureSet documentation.
YAML
Like other Active Record-backed models, ActionText::RichText records inherit from ActiveRecord::Base instances and can therefore be populated by fixtures.
Consider an Article class:
class Article < ApplicationRecord has_rich_text :content end
To declare fixture data for the related content, first declare fixture data for Article instances in test/fixtures/articles.yml:
first: title: An Article
Then declare the ActionText::RichText fixture data in test/fixtures/action_text/rich_texts.yml, making sure to declare each entry’s record: key as a polymorphic relationship:
first: record: first (Article) name: content body: <div>Hello, world.</div>
When processed, Active Record will insert database records for each fixture entry and will ensure the Action Text relationship is intact.