diff options
author | Javan Makhmali <javan@javan.us> | 2019-03-11 08:38:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-11 08:38:52 -0700 |
commit | f1b8bb4e1f16e4029ddf05515db0c01942521116 (patch) | |
tree | f8e37156cb3f1581d34594a1d5940a0eb9a0076a /actiontext/test/unit | |
parent | 4304373788fda6fa0fb1d6bac4ef78fb1ecac3dd (diff) | |
parent | 764803e07a5c89c931df9a1c4fe730f73b7571e6 (diff) | |
download | rails-f1b8bb4e1f16e4029ddf05515db0c01942521116.tar.gz rails-f1b8bb4e1f16e4029ddf05515db0c01942521116.tar.bz2 rails-f1b8bb4e1f16e4029ddf05515db0c01942521116.zip |
Merge pull request #35485 from excid3/default-attachable-trix-partial
Adds default trix content attachmment partial path
Diffstat (limited to 'actiontext/test/unit')
-rw-r--r-- | actiontext/test/unit/attachment_test.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/actiontext/test/unit/attachment_test.rb b/actiontext/test/unit/attachment_test.rb index 65e9d69e84..026078dcec 100644 --- a/actiontext/test/unit/attachment_test.rb +++ b/actiontext/test/unit/attachment_test.rb @@ -32,7 +32,8 @@ class ActionText::AttachmentTest < ActiveSupport::TestCase assert_equal attachable.byte_size, trix_attachment.attributes["filesize"] assert_equal "Captioned", trix_attachment.attributes["caption"] - assert_nil trix_attachment.attributes["content"] + assert_not_nil attachable.to_trix_content_attachment_partial_path + assert_not_nil trix_attachment.attributes["content"] end test "converts to TrixAttachment with content" do @@ -49,6 +50,11 @@ class ActionText::AttachmentTest < ActiveSupport::TestCase assert_not_nil trix_attachment.attributes["content"] end + test "defaults trix partial to model partial" do + attachable = Page.create! title: "Homepage" + assert_equal "pages/page", attachable.to_trix_content_attachment_partial_path + end + private def attachment_from_html(html) ActionText::Content.new(html).attachments.first |