Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed that the request method would be sticky in tests (closes #3849)…
… [lars@pinds.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3622 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Feb 20, 2006
1 parent 377bdd0 commit e875b0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions actionpack/lib/action_controller/test_process.rb
Expand Up @@ -102,8 +102,9 @@ def assign_parameters(controller_path, action, parameters)

def recycle!
self.request_parameters = {}
self.query_parameters = {}
self.path_parameters = {}
self.query_parameters = {}
self.path_parameters = {}
@request_method = nil
end

private
Expand Down
6 changes: 6 additions & 0 deletions actionpack/test/controller/test_test.rb
Expand Up @@ -327,6 +327,12 @@ def test_header_properly_reset_after_remote_http_request
assert_nil @request.env['HTTP_X_REQUESTED_WITH']
end

def test_header_properly_reset_after_get_request
get :test_params
@request.recycle!
assert_nil @request.instance_variable_get("@request_method")
end

%w(controller response request).each do |variable|
%w(get post put delete head process).each do |method|
define_method("test_#{variable}_missing_for_#{method}_raises_error") do
Expand Down

0 comments on commit e875b0d

Please sign in to comment.