From 531d7dd584267e81ba57d4de7f0fe21b18a83cbb Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 12 Sep 2018 15:51:06 -0700 Subject: Never mind on allowing blank More hassle than its worth. Just account for the fact that rich text can be blank instead, but continue to create the record. --- test/unit/content_test.rb | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'test/unit') diff --git a/test/unit/content_test.rb b/test/unit/content_test.rb index 60fb39610b..59beb323cf 100644 --- a/test/unit/content_test.rb +++ b/test/unit/content_test.rb @@ -7,19 +7,11 @@ module ActionText assert_equal "Hello world", message.content.body.to_plain_text end - test "creating a model with rich text content will not create a rich text record" do + test "without content" do message = Message.create!(subject: "Greetings") assert message.content.body.nil? end - test "removing content removes the rich text record" do - message = Message.create!(subject: "Greetings", content: "

Hello world

") - - assert_difference -> { ActionText::RichText.all.count }, -1 do - message.update!(content: "") - end - 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)) -- cgit v1.2.3