diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-29 09:05:46 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-06-29 09:05:46 +0000 |
commit | 571abe8d5e8bd8df8a891bfb214e129cc97cf4a3 (patch) | |
tree | aa1e576902c69ae862fa2817faa02540de1b9cf6 /actionpack/lib/action_controller | |
parent | 2d8679993c3e7ec2920fd818dacc7cb2000b9f89 (diff) | |
download | rails-571abe8d5e8bd8df8a891bfb214e129cc97cf4a3.tar.gz rails-571abe8d5e8bd8df8a891bfb214e129cc97cf4a3.tar.bz2 rails-571abe8d5e8bd8df8a891bfb214e129cc97cf4a3.zip |
Rolled back changed to test_process as it broke havok this morning
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1562 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/test_process.rb | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb index 60c8e1a02c..5248cd1e90 100644 --- a/actionpack/lib/action_controller/test_process.rb +++ b/actionpack/lib/action_controller/test_process.rb @@ -66,11 +66,10 @@ module ActionController #:nodoc: def path @path || super() end - - def generate_route_and_assign_parameters(controller_path, action, parameters) - parameters = parameters.symbolize_keys.merge(:controller => controller_path, :action => action) - path, extras = ActionController::Routing::Routes.generate(parameters) - non_path_parameters = get? ? query_parameters : request_parameters + + def assign_parameters(parameters) + path, extras = ActionController::Routing::Routes.generate(parameters.symbolize_keys) + non_path_parameters = (get? ? query_parameters : request_parameters) parameters.each do |key, value| (extras.key?(key.to_sym) ? non_path_parameters : path_parameters)[key] = value end @@ -249,7 +248,9 @@ module Test @request.action = action.to_s parameters ||= {} - @request.generate_route_and_assign_parameters(@controller.class.controller_path, action.to_s, parameters) + parameters[:controller] = @controller.class.controller_path + parameters[:action] = action.to_s + @request.assign_parameters(parameters) @request.session = ActionController::TestSession.new(session) unless session.nil? @request.session["flash"] = ActionController::Flash::FlashHash.new.update(flash) if flash @@ -306,13 +307,11 @@ module Test end def build_request_uri(action, parameters) - unless @request.env['REQUEST_URI'] - options = @controller.send(:rewrite_options, parameters) - options.update(:only_path => true, :action => action) - - url = ActionController::UrlRewriter.new(@request, parameters) - @request.set_REQUEST_URI(url.rewrite(options)) - end + return if @request.env['REQUEST_URI'] + url = ActionController::UrlRewriter.new(@request, parameters) + @request.set_REQUEST_URI( + url.rewrite(@controller.send(:rewrite_options, + (parameters||{}).update(:only_path => true, :action=>action)))) end def html_document |