diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2018-09-12 15:51:06 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2018-09-12 15:51:06 -0700 |
commit | 531d7dd584267e81ba57d4de7f0fe21b18a83cbb (patch) | |
tree | 1e65cf6bda11cc03bdcebdc9183a84abb5aef58c /test/unit | |
parent | 3431c0b3eeaf284901bd9aa4265c578207d4c820 (diff) | |
download | rails-531d7dd584267e81ba57d4de7f0fe21b18a83cbb.tar.gz rails-531d7dd584267e81ba57d4de7f0fe21b18a83cbb.tar.bz2 rails-531d7dd584267e81ba57d4de7f0fe21b18a83cbb.zip |
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.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/content_test.rb | 10 |
1 files changed, 1 insertions, 9 deletions
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: "<h1>Hello world</h1>") - - 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)) |