From 71dbef6d27210259ae263b84120f94fe9d6784e7 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 3 Sep 2006 23:34:57 +0000 Subject: Integration tests: thoroughly test ActionController::Integration::Session. Closes #6022. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4954 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/integration.rb | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/integration.rb b/actionpack/lib/action_controller/integration.rb index 7676d15c2d..57872e8e8b 100644 --- a/actionpack/lib/action_controller/integration.rb +++ b/actionpack/lib/action_controller/integration.rb @@ -151,13 +151,24 @@ module ActionController process :get, path, parameters, headers end - # keep the docs for #get - %w( post put delete head ).each do |method| - class_eval <<-EOV, __FILE__, __LINE__ - def #{method}(path, parameters=nil, headers=nil) - process :#{method}, path, parameters, headers - end - EOV + # Performs a POST request with the given parameters. See get() for more details. + def post(path, parameters=nil, headers=nil) + process :post, path, parameters, headers + end + + # Performs a PUT request with the given parameters. See get() for more details. + def put(path, parameters=nil, headers=nil) + process :put, path, parameters, headers + end + + # Performs a DELETE request with the given parameters. See get() for more details. + def delete(path, parameters=nil, headers=nil) + process :delete, path, parameters, headers + end + + # Performs a HEAD request with the given parameters. See get() for more details. + def head(path, parameters=nil, headers=nil) + process :head, path, parameters, headers end # Performs an XMLHttpRequest request with the given parameters, mimicing -- cgit v1.2.3