diff options
author | Timm <kaspth@gmail.com> | 2013-08-16 16:49:55 +0200 |
---|---|---|
committer | Timm <kaspth@gmail.com> | 2014-06-16 21:04:07 +0200 |
commit | 1825edccf258f24479e75481cfe7e14139a1e878 (patch) | |
tree | 18214cbeb6fc7ae8c4c83462345f9d277c295c84 /actionview/test | |
parent | 97c5e6fa027d0ef9151172c193b1f61ee4c4c70a (diff) | |
download | rails-1825edccf258f24479e75481cfe7e14139a1e878.tar.gz rails-1825edccf258f24479e75481cfe7e14139a1e878.tar.bz2 rails-1825edccf258f24479e75481cfe7e14139a1e878.zip |
Renamed: remove_xpaths tests no longer prefixed with sanitizer.
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/sanitizers_test.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/actionview/test/template/sanitizers_test.rb b/actionview/test/template/sanitizers_test.rb index 8d2934caed..6769c765fa 100644 --- a/actionview/test/template/sanitizers_test.rb +++ b/actionview/test/template/sanitizers_test.rb @@ -11,38 +11,38 @@ class SanitizersTest < ActionController::TestCase end end - def test_sanitizer_remove_xpaths_removes_an_xpath + def test_remove_xpaths_removes_an_xpath sanitizer = ActionView::Sanitizer.new html = %(<h1>hello <script>code!</script></h1>) assert_equal %(<h1>hello </h1>), sanitizer.remove_xpaths(html, %w(.//script)) end - def test_sanitizer_remove_xpaths_removes_all_occurences_of_xpath + def test_remove_xpaths_removes_all_occurences_of_xpath sanitizer = ActionView::Sanitizer.new html = %(<section><header><script>code!</script></header><p>hello <script>code!</script></p></section>) assert_equal %(<section><header></header><p>hello </p></section>), sanitizer.remove_xpaths(html, %w(.//script)) end - def test_sanitizer_remove_xpaths_not_enumerable_xpaths_parameter + def test_remove_xpaths_not_enumerable_xpaths_parameter sanitizer = ActionView::Sanitizer.new assert_raises NoMethodError do sanitizer.remove_xpaths('<h1>hello<h1>', './not_enumerable') end end - def test_sanitizer_remove_xpaths_faulty_xpath + def test_remove_xpaths_faulty_xpath sanitizer = ActionView::Sanitizer.new assert_raises Nokogiri::XML::XPath::SyntaxError do sanitizer.remove_xpaths('<h1>hello<h1>', %w(..faulty_xpath)) end end - def test_sanitizer_remove_xpaths_called_with_string_returns_string + def test_remove_xpaths_called_with_string_returns_string sanitizer = ActionView::Sanitizer.new assert '<a></a>', sanitizer.remove_xpaths('<a></a>', []) end - def test_sanitizer_remove_xpaths_called_with_fragment_returns_fragment + def test_remove_xpaths_called_with_fragment_returns_fragment sanitizer = ActionView::Sanitizer.new fragment = sanitizer.remove_xpaths(Loofah.fragment('<a></a>'), []) assert_kind_of Loofah::HTML::DocumentFragment, fragment |