From 045774aec722d2f6bae99e8b3143b3e893e5eb29 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Fri, 27 May 2022 17:56:04 -0400 Subject: [PATCH] test: clean up tests by using the helpers --- test/sanitizer_test.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/sanitizer_test.rb b/test/sanitizer_test.rb index 8b0b7ab..5bf188e 100644 --- a/test/sanitizer_test.rb +++ b/test/sanitizer_test.rb @@ -14,13 +14,11 @@ def test_sanitizer_sanitize_raises_not_implemented_error end def test_sanitize_nested_script - sanitizer = Rails::Html::SafeListSanitizer.new - assert_equal '<script>alert("XSS");</script>', sanitizer.sanitize('alert("XSS");/', tags: %w(em)) + assert_equal '<script>alert("XSS");</script>', safe_list_sanitize('alert("XSS");/', tags: %w(em)) end def test_sanitize_nested_script_in_style - sanitizer = Rails::Html::SafeListSanitizer.new - assert_equal '<script>alert("XSS");</script>', sanitizer.sanitize('alert("XSS");/', tags: %w(em)) + assert_equal '<script>alert("XSS");</script>', safe_list_sanitize('alert("XSS");/', tags: %w(em)) end class XpathRemovalTestSanitizer < Rails::Html::Sanitizer