From 3b1c30c99ff1f3f5e970e3fa696d3291d5897bd7 Mon Sep 17 00:00:00 2001 From: Vasiliy Ermolovich Date: Fri, 18 May 2012 18:17:43 +0300 Subject: doesn't modify params in SafeBuffer#% --- activesupport/test/core_ext/string_ext_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activesupport/test/core_ext') 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 = ["

", "", "

"] + "%s %s %s".html_safe % @other_string + + assert_equal ["

", "", "

"], @other_string + end + test "Concatting a fixnum to safe always yields safe" do string = @string.html_safe string = string.concat(13) -- cgit v1.2.3