Namespace
Methods
T
Included Modules
Instance Public methods
test_html_escape_is_html_safe()
# File actionpack/test/template/erb_util_test.rb, line 29
def test_html_escape_is_html_safe
  escaped = h("<p>")
  assert_equal "&lt;p&gt;", escaped
  assert escaped.html_safe?
end
test_html_escape_passes_html_escpe_unmodified()
# File actionpack/test/template/erb_util_test.rb, line 35
def test_html_escape_passes_html_escpe_unmodified
  escaped = h("<p>".html_safe)
  assert_equal "<p>", escaped
  assert escaped.html_safe?
end
test_json_escape_returns_safe_strings_when_passed_safe_strings()
# File actionpack/test/template/erb_util_test.rb, line 24
def test_json_escape_returns_safe_strings_when_passed_safe_strings
  value = json_escape("asdf".html_safe)
  assert value.html_safe?
end
test_json_escape_returns_unsafe_strings_when_passed_unsafe_strings()
# File actionpack/test/template/erb_util_test.rb, line 19
def test_json_escape_returns_unsafe_strings_when_passed_unsafe_strings
  value = json_escape("asdf")
  assert !value.html_safe?
end
test_rest_in_ascii()
# File actionpack/test/template/erb_util_test.rb, line 41
def test_rest_in_ascii
  (0..127).to_a.map {|int| int.chr }.each do |chr|
    next if chr.in?('&"<>\')
    assert_equal chr, html_escape(chr)
  end
end