diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-08 10:43:24 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-08 10:43:24 +0000 |
commit | c8d68dfed3c83f3b5c32dc58d797254b219744b9 (patch) | |
tree | e2ba01dbe728670d8879802c6732e8d68d8c481d /actionpack/lib/action_controller | |
parent | 4e1eaa289b8e410277a8dfb9a0c5139cafcbb23e (diff) | |
download | rails-c8d68dfed3c83f3b5c32dc58d797254b219744b9.tar.gz rails-c8d68dfed3c83f3b5c32dc58d797254b219744b9.tar.bz2 rails-c8d68dfed3c83f3b5c32dc58d797254b219744b9.zip |
Killed the out of place alias and made sure you can use the different HTTP methods within the same testaction
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@80 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/test_process.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb index 41fc2f209b..314f087f6f 100644 --- a/actionpack/lib/action_controller/test_process.rb +++ b/actionpack/lib/action_controller/test_process.rb @@ -190,7 +190,7 @@ end class Test::Unit::TestCase #:nodoc: private # execute the request and set/volley the response - def get(action, parameters = nil, session = nil) + def process(action, parameters = nil, session = nil) @request.env['REQUEST_METHOD'] ||= "GET" @request.action = action.to_s @request.parameters.update(parameters) unless parameters.nil? @@ -199,14 +199,13 @@ class Test::Unit::TestCase #:nodoc: end # execute the request simulating a specific http method and set/volley the response - %w( post put delete head ).each do |method| + %w( get post put delete head ).each do |method| class_eval <<-EOV def #{method}(action, parameters = nil, session = nil) - @request.env['REQUEST_METHOD'] ||= "#{method.upcase}" - get(action, parameters, session) + @request.env['REQUEST_METHOD'] = "#{method.upcase}" + process(action, parameters, session) end -EOV + EOV end - alias :process :get end
\ No newline at end of file |