require 'test_helper' class NoteSanitizerTest < ActiveSupport::TestCase context "Sanitizing a note" do should "strip unsafe tags" do body = '
test
' assert_equal('test
alert("owned")', NoteSanitizer.sanitize(body)) end should "strip unsafe css" do body = 'test
' assert_equal("test
", NoteSanitizer.sanitize(body)) end should "allow style attributes on every tag" do body = 'test
' assert_equal('test
', NoteSanitizer.sanitize(body)) end should "mark links as nofollow" do body = 'google' assert_equal('google', NoteSanitizer.sanitize(body)) end end end