aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/string_ext_test.rb
diff options
context:
space:
mode:
authorEugene Gilburg <eugene.gilburg@gmail.com>2014-07-19 12:49:52 -0700
committerEugene Gilburg <eugene.gilburg@gmail.com>2014-07-19 17:15:40 -0700
commit3b9cc0a56f4cbfb97f12c5a167ac901f7682bbe2 (patch)
treeb4ebd67d449a380aa404bbce011898e5eddc9fe9 /activesupport/test/core_ext/string_ext_test.rb
parent08754f12e65a9ec79633a605e986d0f1ffa4b251 (diff)
downloadrails-3b9cc0a56f4cbfb97f12c5a167ac901f7682bbe2.tar.gz
rails-3b9cc0a56f4cbfb97f12c5a167ac901f7682bbe2.tar.bz2
rails-3b9cc0a56f4cbfb97f12c5a167ac901f7682bbe2.zip
missing activesupport test coverage
Diffstat (limited to 'activesupport/test/core_ext/string_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/string_ext_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb
index f74b1c8078..d77e6be595 100644
--- a/activesupport/test/core_ext/string_ext_test.rb
+++ b/activesupport/test/core_ext/string_ext_test.rb
@@ -775,6 +775,14 @@ class OutputSafetyTest < ActiveSupport::TestCase
string = "<b>hello</b>".html_safe
assert_equal string, ERB::Util.html_escape(string)
end
+
+ test "ERB::Util.html_escape_once only escapes once" do
+ string = '1 < 2 &amp; 3'
+ escaped_string = "1 &lt; 2 &amp; 3"
+
+ assert_equal escaped_string, ERB::Util.html_escape_once(string)
+ assert_equal escaped_string, ERB::Util.html_escape_once(escaped_string)
+ end
end
class StringExcludeTest < ActiveSupport::TestCase