diff options
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 34499fa784..21281b606e 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -139,14 +139,16 @@ module ActionController end end - params = self.request_parameters.dup + # Clear the combined params hash in case it was already referenced. + @env.delete("action_dispatch.request.parameters") + params = self.request_parameters.dup %w(controller action only_path).each do |k| params.delete(k) params.delete(k.to_sym) end - data = params.to_query + @env['CONTENT_LENGTH'] = data.length.to_s @env['rack.input'] = StringIO.new(data) end @@ -155,6 +157,8 @@ module ActionController @formats = nil @env.delete_if { |k, v| k =~ /^(action_dispatch|rack)\.request/ } @env.delete_if { |k, v| k =~ /^action_dispatch\.rescue/ } + @method = @request_method = nil + @fullpath = @ip = @remote_ip = nil @env['action_dispatch.request.query_parameters'] = {} end end @@ -167,9 +171,7 @@ module ActionController @block = nil @length = 0 @body = [] - @charset = nil - @content_type = nil - + @charset = @content_type = nil @request = @template = nil end end |