1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actiontext/test/unit/fixture_set_test.rb
Sean Doyle 76b33aa3d1
Add ActionText::FixtureSet.attachment
Permit generating rich-text attachment markup in YAML fixtures:

    hello_world_review_content:
      record: hello_world (Review)
      name: content
      body: <p><%= ActionText::FixtureSet.attachment("messages", :hello_world) %> is great!</p>
2020-10-30 15:53:35 -04:00

14 lines
340 B
Ruby

# frozen_string_literal: true
require "test_helper"
class ActionText::FixtureSetTest < ActiveSupport::TestCase
def test_action_text_attachment
message = messages(:hello_world)
review = reviews(:hello_world)
attachments = review.content.body.attachments
assert_includes attachments.map(&:attachable), message
end
end