Permalink
Browse files

Reset request.parameters after assigning params for functional tests

  • Loading branch information...
jeremy committed Jun 6, 2010
1 parent 509f3d7 commit 9f93de9d3dd7db8de67cb0ee10ea03cdba9b6e5c
Showing with 4 additions and 2 deletions.
  1. +4 −2 actionpack/lib/action_controller/test_case.rb
@@ -139,14 +139,16 @@ def assign_parameters(routes, controller_path, action, parameters = {})
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

1 comment on commit 9f93de9

@augustl

This comment has been minimized.

Show comment Hide comment
Please sign in to comment.