aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorPat Allan <pat@freelancing-gods.com>2017-06-20 22:20:04 +1000
committerPat Allan <pat@freelancing-gods.com>2017-06-20 22:20:04 +1000
commit3d453b409d037a056d0bcd636a2e020cc7cef4a8 (patch)
tree2b1bc8943f5b064fb74e2d7022a882547c82c21f /actionpack/lib/action_dispatch
parentdd491b24ff28f637b1c8879002adb1acdf20a8ac (diff)
downloadrails-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 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/journey/router/utils.rb2
-rw-r--r--actionpack/lib/action_dispatch/testing/assertions/response.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/journey/router/utils.rb b/actionpack/lib/action_dispatch/journey/router/utils.rb
index b3896faf56..1ac86d10d6 100644
--- a/actionpack/lib/action_dispatch/journey/router/utils.rb
+++ b/actionpack/lib/action_dispatch/journey/router/utils.rb
@@ -18,7 +18,7 @@ module ActionDispatch
path.squeeze!("/".freeze)
path.sub!(%r{/+\Z}, "".freeze)
path.gsub!(/(%[a-f0-9]{2})/) { $1.upcase }
- path = "/" if path == "".freeze
+ path = "/".dup if path == "".freeze
path.force_encoding(encoding)
path
end
diff --git a/actionpack/lib/action_dispatch/testing/assertions/response.rb b/actionpack/lib/action_dispatch/testing/assertions/response.rb
index 1baf979ac9..749f2eab57 100644
--- a/actionpack/lib/action_dispatch/testing/assertions/response.rb
+++ b/actionpack/lib/action_dispatch/testing/assertions/response.rb
@@ -79,7 +79,7 @@ module ActionDispatch
def generate_response_message(expected, actual = @response.response_code)
"Expected response to be a <#{code_with_name(expected)}>,"\
" but was a <#{code_with_name(actual)}>"
- .concat(location_if_redirected).concat(response_body_if_short)
+ .dup.concat(location_if_redirected).concat(response_body_if_short)
end
def response_body_if_short