diff --git a/test/unit/note_sanitizer_test.rb b/test/unit/note_sanitizer_test.rb new file mode 100644 index 000000000..8a089825d --- /dev/null +++ b/test/unit/note_sanitizer_test.rb @@ -0,0 +1,15 @@ +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 + end +end