aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
diff options
context:
space:
mode:
authorVasiliy Ermolovich <younash@gmail.com>2012-05-18 18:17:43 +0300
committerVasiliy Ermolovich <younash@gmail.com>2012-05-18 18:30:48 +0300
commit3b1c30c99ff1f3f5e970e3fa696d3291d5897bd7 (patch)
treed05293c529c0091f92ec9582bd840c2c54e1e764 /activesupport/test/core_ext
parent62c6ac2f8d423c62bffc18e06d90bb3b87a7c79a (diff)
downloadrails-3b1c30c99ff1f3f5e970e3fa696d3291d5897bd7.tar.gz
rails-3b1c30c99ff1f3f5e970e3fa696d3291d5897bd7.tar.bz2
rails-3b1c30c99ff1f3f5e970e3fa696d3291d5897bd7.zip
doesn't modify params in SafeBuffer#%
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r--activesupport/test/core_ext/string_ext_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb
index eee2caa60e..d3f52c04c4 100644
--- a/activesupport/test/core_ext/string_ext_test.rb
+++ b/activesupport/test/core_ext/string_ext_test.rb
@@ -463,6 +463,13 @@ class OutputSafetyTest < ActiveSupport::TestCase
assert @other_string.html_safe?
end
+ test "Concatting with % doesn't modify a string" do
+ @other_string = ["<p>", "<b>", "<h1>"]
+ "%s %s %s".html_safe % @other_string
+
+ assert_equal ["<p>", "<b>", "<h1>"], @other_string
+ end
+
test "Concatting a fixnum to safe always yields safe" do
string = @string.html_safe
string = string.concat(13)