diff options
author | Pat Allan <pat@freelancing-gods.com> | 2017-06-20 22:20:04 +1000 |
---|---|---|
committer | Pat Allan <pat@freelancing-gods.com> | 2017-06-20 22:20:04 +1000 |
commit | 3d453b409d037a056d0bcd636a2e020cc7cef4a8 (patch) | |
tree | 2b1bc8943f5b064fb74e2d7022a882547c82c21f /actionview/test/template/form_helper | |
parent | dd491b24ff28f637b1c8879002adb1acdf20a8ac (diff) | |
download | rails-3d453b409d037a056d0bcd636a2e020cc7cef4a8.tar.gz rails-3d453b409d037a056d0bcd636a2e020cc7cef4a8.tar.bz2 rails-3d453b409d037a056d0bcd636a2e020cc7cef4a8.zip |
Make ActionView frozen string literal friendly.
Plus a couple of related ActionPack patches.
Diffstat (limited to 'actionview/test/template/form_helper')
-rw-r--r-- | actionview/test/template/form_helper/form_with_test.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/actionview/test/template/form_helper/form_with_test.rb b/actionview/test/template/form_helper/form_with_test.rb index ecdd5ce672..df81315b9c 100644 --- a/actionview/test/template/form_helper/form_with_test.rb +++ b/actionview/test/template/form_helper/form_with_test.rb @@ -16,7 +16,7 @@ class FormWithActsLikeFormTagTest < FormWithTest method = options[:method] skip_enforcing_utf8 = options.fetch(:skip_enforcing_utf8, false) - "".tap do |txt| + "".dup.tap do |txt| unless skip_enforcing_utf8 txt << %{<input name="utf8" type="hidden" value="✓" />} end @@ -32,7 +32,7 @@ class FormWithActsLikeFormTagTest < FormWithTest method = method.to_s == "get" ? "get" : "post" - txt = %{<form accept-charset="UTF-8" action="#{action}"} + txt = %{<form accept-charset="UTF-8" action="#{action}"}.dup txt << %{ enctype="multipart/form-data"} if enctype txt << %{ data-remote="true"} unless local txt << %{ class="#{html_class}"} if html_class @@ -2194,9 +2194,9 @@ class FormWithActsLikeFormForTest < FormWithTest method = options[:method] if options.fetch(:skip_enforcing_utf8, false) - txt = "" + txt = "".dup else - txt = %{<input name="utf8" type="hidden" value="✓" />} + txt = %{<input name="utf8" type="hidden" value="✓" />}.dup end if method && !%w(get post).include?(method.to_s) @@ -2207,7 +2207,7 @@ class FormWithActsLikeFormForTest < FormWithTest end def form_text(action = "/", id = nil, html_class = nil, local = nil, multipart = nil, method = nil) - txt = %{<form accept-charset="UTF-8" action="#{action}"} + txt = %{<form accept-charset="UTF-8" action="#{action}"}.dup txt << %{ enctype="multipart/form-data"} if multipart txt << %{ data-remote="true"} unless local txt << %{ class="#{html_class}"} if html_class |