From 76b33aa3d102ad4ff3f766ac2d3a711d73aaee82 Mon Sep 17 00:00:00 2001 From: Sean Doyle Date: Fri, 30 Oct 2020 15:53:35 -0400 Subject: [PATCH] Add ActionText::FixtureSet.attachment Permit generating rich-text attachment markup in YAML fixtures: hello_world_review_content: record: hello_world (Review) name: content body:

<%= ActionText::FixtureSet.attachment("messages", :hello_world) %> is great!

--- actiontext/CHANGELOG.md | 13 +++++++++++++ actiontext/lib/action_text.rb | 1 + actiontext/lib/action_text/fixture_set.rb | 12 ++++++++++++ .../test/fixtures/action_text/rich_texts.yml | 4 ++++ actiontext/test/fixtures/messages.yml | 2 ++ actiontext/test/fixtures/reviews.yml | 3 +++ actiontext/test/unit/fixture_set_test.rb | 14 ++++++++++++++ activerecord/lib/active_record/fixtures.rb | 8 ++++++++ guides/source/6_1_release_notes.md | 4 ++++ 9 files changed, 61 insertions(+) create mode 100644 actiontext/lib/action_text/fixture_set.rb create mode 100644 actiontext/test/fixtures/action_text/rich_texts.yml create mode 100644 actiontext/test/fixtures/messages.yml create mode 100644 actiontext/test/fixtures/reviews.yml create mode 100644 actiontext/test/unit/fixture_set_test.rb diff --git a/actiontext/CHANGELOG.md b/actiontext/CHANGELOG.md index 393daabfa3..3e97ffb0d6 100644 --- a/actiontext/CHANGELOG.md +++ b/actiontext/CHANGELOG.md @@ -1,3 +1,16 @@ +* Declare `ActionText::FixtureSet.attachment` to generate an + `` element with + a valid `sgid` attribute. + + ```ruby + hello_world_review_content: + record: hello_world (Review) + name: content + body:

<%= ActionText::FixtureSet.attachment("messages", :hello_world) %> is great!

+ ``` + + *Sean Doyle* + * Locate `fill_in_rich_text_area` by `