aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorTimm <kaspth@gmail.com>2013-09-13 15:52:39 +0200
committerTimm <kaspth@gmail.com>2014-06-16 21:04:13 +0200
commit0a0d151bb8dd9c4a04befbaa302471860a530a94 (patch)
treee462fd0cffa5e3979844a48512bee320d90e3dcf /actionview/test
parent5430487d85de3e6ac0d886e384ef039f15e64a88 (diff)
downloadrails-0a0d151bb8dd9c4a04befbaa302471860a530a94.tar.gz
rails-0a0d151bb8dd9c4a04befbaa302471860a530a94.tar.bz2
rails-0a0d151bb8dd9c4a04befbaa302471860a530a94.zip
Now returning html if html is blank? in FullSanitizer and WhiteListSanitizer. This means it'll return false if called with false, however that is not a valid use case.
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/sanitizers_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionview/test/template/sanitizers_test.rb b/actionview/test/template/sanitizers_test.rb
index dc511b6ec2..48079bf060 100644
--- a/actionview/test/template/sanitizers_test.rb
+++ b/actionview/test/template/sanitizers_test.rb
@@ -98,7 +98,7 @@ class SanitizersTest < ActionController::TestCase
assert_equal("This is a test.", sanitizer.sanitize("<p>This <u>is<u> a <a href='test.html'><strong>test</strong></a>.</p>"))
assert_equal("", sanitizer.sanitize("<<<bad html>"))
-
+
assert_equal("This is a test.", sanitizer.sanitize("This is a test."))
assert_equal "This has a here.", sanitizer.sanitize("This has a <!-- comment --> here.")
@@ -219,7 +219,7 @@ class SanitizersTest < ActionController::TestCase
def test_should_raise_argument_error_if_tags_is_not_enumerable
sanitizer = ActionView::WhiteListSanitizer.new
e = assert_raise(ArgumentError) do
- sanitizer.sanitize('', :tags => 'foo')
+ sanitizer.sanitize('<a>some html</a>', :tags => 'foo')
end
assert_equal "You should pass :tags as an Enumerable", e.message
@@ -228,7 +228,7 @@ class SanitizersTest < ActionController::TestCase
def test_should_raise_argument_error_if_attributes_is_not_enumerable
sanitizer = ActionView::WhiteListSanitizer.new
e = assert_raise(ArgumentError) do
- sanitizer.sanitize('', :attributes => 'foo')
+ sanitizer.sanitize('<a>some html</a>', :attributes => 'foo')
end
assert_equal "You should pass :attributes as an Enumerable", e.message
@@ -242,7 +242,7 @@ class SanitizersTest < ActionController::TestCase
end
assert_raise Loofah::ScrubberNotFound do
- sanitizer.sanitize('', :scrubber => scrubber)
+ sanitizer.sanitize('<a>some html</a>', :scrubber => scrubber)
end
end