aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/test_process.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/test_process.rb')
-rw-r--r--actionpack/lib/action_controller/test_process.rb39
1 files changed, 21 insertions, 18 deletions
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb
index 314f087f6f..3590d29cd3 100644
--- a/actionpack/lib/action_controller/test_process.rb
+++ b/actionpack/lib/action_controller/test_process.rb
@@ -187,25 +187,28 @@ end
end
end
-class Test::Unit::TestCase #:nodoc:
- private
- # execute the request and set/volley the response
- def process(action, parameters = nil, session = nil)
- @request.env['REQUEST_METHOD'] ||= "GET"
- @request.action = action.to_s
- @request.parameters.update(parameters) unless parameters.nil?
- @request.session = ActionController::TestSession.new(session) unless session.nil?
- @controller.process(@request, @response)
- end
+module Test
+ module Unit
+ class TestCase #:nodoc:
+ private
+ # execute the request and set/volley the response
+ def process(action, parameters = nil, session = nil)
+ @request.env['REQUEST_METHOD'] ||= "GET"
+ @request.action = action.to_s
+ @request.parameters.update(parameters) unless parameters.nil?
+ @request.session = ActionController::TestSession.new(session) unless session.nil?
+ @controller.process(@request, @response)
+ end
- # execute the request simulating a specific http method and set/volley the response
- %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}"
- process(action, parameters, session)
+ # execute the request simulating a specific http method and set/volley the response
+ %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}"
+ process(action, parameters, session)
+ end
+ EOV
end
- EOV
end
-
+ end
end \ No newline at end of file