diff options
author | Yehuda Katz <wycats@Yehuda-Katz.local> | 2010-01-31 19:17:42 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@Yehuda-Katz.local> | 2010-01-31 19:39:13 -0800 |
commit | 4cbb9db0a5ff65b0a626a5b043331abefd89e717 (patch) | |
tree | a112ce55f5521ff31abf0e4357afcc170fc0a143 /actionpack/test/template/erb_util_test.rb | |
parent | 1c83fd2eff3fd174e1aba0512aa2dd8ecdadb2c7 (diff) | |
download | rails-4cbb9db0a5ff65b0a626a5b043331abefd89e717.tar.gz rails-4cbb9db0a5ff65b0a626a5b043331abefd89e717.tar.bz2 rails-4cbb9db0a5ff65b0a626a5b043331abefd89e717.zip |
For performance reasons, you can no longer call html_safe! on Strings. Instead, all Strings are always not html_safe?. Instead, you can get a SafeBuffer from a String by calling #html_safe, which will SafeBuffer.new(self).
* Additionally, instead of doing concat("</form>".html_safe), you can do
safe_concat("</form>"), which will skip both the flag set, and the flag
check.
* For the first pass, I converted virtually all #html_safe!s to #html_safe,
and the tests pass. A further optimization would be to try to use
#safe_concat as much as possible, reducing the performance impact if
we know up front that a String is safe.
Diffstat (limited to 'actionpack/test/template/erb_util_test.rb')
-rw-r--r-- | actionpack/test/template/erb_util_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/test/template/erb_util_test.rb b/actionpack/test/template/erb_util_test.rb index fa6b263965..06155b1f30 100644 --- a/actionpack/test/template/erb_util_test.rb +++ b/actionpack/test/template/erb_util_test.rb @@ -22,7 +22,7 @@ class ErbUtilTest < Test::Unit::TestCase end def test_html_escape_passes_html_escpe_unmodified - escaped = h("<p>".html_safe!) + escaped = h("<p>".html_safe) assert_equal "<p>", escaped assert escaped.html_safe? end |