Backfill tests for Event::Description strings' html-safety
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user