From fa10787447162c662e72b653f1d114834efddfb5 Mon Sep 17 00:00:00 2001 From: Volmer Date: Fri, 1 Jul 2016 15:16:28 -0400 Subject: Fix request encoding in tests when string literals are frozen When running tests with `--enable-frozen-string-literal` or `# frozen_string_literal: true`, it's currently attempted to mutate the path string in order to append the format, causing a `RuntimeError`. ```ruby get '/posts', as: :json ``` ``` RuntimeError: can't modify frozen String ``` This commit fixes the problem by replacing the mutation with a concatenation, returning a new string. --- actionpack/lib/action_dispatch/testing/integration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/testing/integration.rb') diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index 5627e79bb7..ecd02b8c2e 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -423,7 +423,7 @@ module ActionDispatch end def append_format_to(path) - path << @path_format unless @url_encoded_form + path += @path_format unless @url_encoded_form path end -- cgit v1.2.3