diff options
author | José Valim <jose.valim@gmail.com> | 2012-05-18 09:04:51 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-05-18 09:04:51 -0700 |
commit | fa561a537d5188d09fcc47e257378e953df4858e (patch) | |
tree | 5f39e0a066cbd3f93a0fd3e2466c0c3f54298cb3 /activesupport/test | |
parent | 1ae68ea35fcbdf43fd86bbf665c67266d61f1308 (diff) | |
parent | 3b1c30c99ff1f3f5e970e3fa696d3291d5897bd7 (diff) | |
download | rails-fa561a537d5188d09fcc47e257378e953df4858e.tar.gz rails-fa561a537d5188d09fcc47e257378e953df4858e.tar.bz2 rails-fa561a537d5188d09fcc47e257378e953df4858e.zip |
Merge pull request #6380 from nashby/output-safety-interpolation
doesn't modify params in SafeBuffer#%
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/string_ext_test.rb | 7 |
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) |