Backfill tests for Event::Description strings' html-safety

This commit is contained in:
Mike Dalessio
2026-02-12 15:52:56 -05:00
parent 8aa934a594
commit 4ead778e12
+12
View File
@@ -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))