aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/erb_util_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/template/erb_util_test.rb')
-rw-r--r--actionpack/test/template/erb_util_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/template/erb_util_test.rb b/actionpack/test/template/erb_util_test.rb
index 49f51c50c5..fa6b263965 100644
--- a/actionpack/test/template/erb_util_test.rb
+++ b/actionpack/test/template/erb_util_test.rb
@@ -15,6 +15,18 @@ class ErbUtilTest < Test::Unit::TestCase
end
end
+ def test_html_escape_is_html_safe
+ escaped = h("<p>")
+ assert_equal "&lt;p&gt;", escaped
+ assert escaped.html_safe?
+ end
+
+ def test_html_escape_passes_html_escpe_unmodified
+ escaped = h("<p>".html_safe!)
+ assert_equal "<p>", escaped
+ assert escaped.html_safe?
+ end
+
def test_rest_in_ascii
(0..127).to_a.map {|int| int.chr }.each do |chr|
next if %w(& " < >).include?(chr)