aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-07-31 20:49:35 -0400
committerGeorge Claghorn <george@basecamp.com>2018-07-31 20:49:35 -0400
commit0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b (patch)
treeac5a99fd643c17f0e100496321a4b4c404e5bb11 /test/unit
parent36b69850cc6cafa60230ca92eabb9ad93adf7e81 (diff)
downloadrails-0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b.tar.gz
rails-0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b.tar.bz2
rails-0fd8ba6ffff07a4556ec47840ef8c9dbd10e5e8b.zip
Prefer the ASt API
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/content_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/unit/content_test.rb b/test/unit/content_test.rb
index b1a06e2cfa..f1acf054db 100644
--- a/test/unit/content_test.rb
+++ b/test/unit/content_test.rb
@@ -6,5 +6,11 @@ module ActionText
message = Message.new(subject: "Greetings", content: "<h1>Hello world</h1>")
assert_equal "Hello world", message.content.body.to_plain_text
end
+
+ test "embed extraction" do
+ blob = create_file_blob(filename: "racecar.jpg", content_type: "image/jpg")
+ message = Message.create!(subject: "Greetings", content: ActionText::Content.new("Hello world").append_attachables(blob))
+ assert_equal "racecar.jpg", message.content.embeds.first.filename.to_s
+ end
end
end