From 59c64439d8cb474c0986993023a08ebbe88656c4 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Sat, 24 Feb 2007 00:41:35 -0600 Subject: [PATCH] More unit tests. --- test/unit/sanitize_test.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/unit/sanitize_test.rb b/test/unit/sanitize_test.rb index 7a2fd813..db0d4bc2 100644 --- a/test/unit/sanitize_test.rb +++ b/test/unit/sanitize_test.rb @@ -40,6 +40,13 @@ class SanitizeTest < Test::Unit::TestCase end end + Sanitize::ALLOWED_PROTOCOLS.each do |protocol| + define_method "test_should_allow_#{protocol}_uris" do + assert_equal "foo", + sanitize_html(%(foo)) + end + end + def test_should_allow_anchors assert_equal "<script>baz</script>", sanitize_html("") @@ -72,7 +79,7 @@ class SanitizeTest < Test::Unit::TestCase end end -[%(), + [%(), %(), %(), %(),