diff --git a/test/models/event/description_test.rb b/test/models/event/description_test.rb index 3139a0c47..9ff271c38 100644 --- a/test/models/event/description_test.rb +++ b/test/models/event/description_test.rb @@ -1,6 +1,12 @@ require "test_helper" class Event::DescriptionTest < ActiveSupport::TestCase + test "html description is html safe" do + description = events(:logo_published).description_for(users(:david)) + + assert_predicate description.to_html, :html_safe? + end + test "generates html description for card published event" do description = events(:logo_published).description_for(users(:david)) @@ -8,6 +14,12 @@ class Event::DescriptionTest < ActiveSupport::TestCase assert_includes description.to_html, "logo" end + test "plain text description is not html safe" do + description = events(:logo_published).description_for(users(:david)) + + assert_not_predicate description.to_plain_text, :html_safe? + end + test "generates plain text description for card published event" do description = events(:logo_published).description_for(users(:david))