Namespace
- MODULE ErbUtilTest::ERB
Methods
- T
-
- test_html_escape,
- test_html_escape_is_html_safe,
- test_html_escape_once,
- test_html_escape_once_returns_safe_strings_when_passed_safe_strings,
- test_html_escape_once_returns_unsafe_strings_when_passed_unsafe_strings,
- test_html_escape_passes_html_escape_unmodified,
- test_json_escape,
- test_json_escape_does_not_alter_json_string_meaning,
- test_json_escape_is_idempotent,
- test_json_escape_returns_safe_strings_when_passed_safe_strings,
- test_json_escape_returns_unsafe_strings_when_passed_unsafe_strings,
- test_rest_in_ascii
Included Modules
Constants
| HTML_ESCAPE_TEST_CASES | = | [ ['<br>', '<br>'], ['a & b', 'a & b'], ['"quoted" string', '"quoted" string'], ["'quoted' string", ''quoted' string'], [ '<script type="application/javascript">alert("You are \'pwned\'!")</script>', '<script type="application/javascript">alert("You are 'pwned'!")</script>' ] ] |
| JSON_ESCAPE_TEST_CASES | = | [ ['1', '1'], ['null', 'null'], ['"&"', '"\u0026"'], ['"</script>"', '"\u003c/script\u003e"'], ['["</script>"]', '["\u003c/script\u003e"]'], ['{"name":"</script>"}', '{"name":"\u003c/script\u003e"}'], [%({"name":"d\u2028h\u2029h"}), '{"name":"d\u2028h\u2029h"}'] ] |
Instance Public methods
test_html_escape()
Link
test_html_escape_is_html_safe()
Link
test_html_escape_once()
Link
# File actionview/test/template/erb_util_test.rb, line 93 def test_html_escape_once assert_equal '1 <>&"' 2 & 3', html_escape_once('1 <>&"\ 2 & 3') assert_equal " ' ' λ λ " ' < > ", html_escape_once(" ' ' λ λ \" ' < > ") end
test_html_escape_once_returns_safe_strings_when_passed_safe_strings()
Link
test_html_escape_once_returns_unsafe_strings_when_passed_unsafe_strings()
Link
test_html_escape_passes_html_escape_unmodified()
Link
test_json_escape()
Link
test_json_escape_does_not_alter_json_string_meaning()
Link
test_json_escape_is_idempotent()
Link
test_json_escape_returns_safe_strings_when_passed_safe_strings()
Link
test_json_escape_returns_unsafe_strings_when_passed_unsafe_strings()
Link