diff options
author | Joshua Peek <josh@joshpeek.com> | 2010-03-09 20:50:35 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2010-03-09 20:50:35 -0600 |
commit | 7db80f87e9c194713c2016820e39af6043ddf8d0 (patch) | |
tree | 310fb27f2831a8fcf1598f4522e28e236f5d8172 /actionpack/lib/action_controller/test_case.rb | |
parent | a87683fb38d6cf66f39a7bd3faa6c969c63b1f46 (diff) | |
download | rails-7db80f87e9c194713c2016820e39af6043ddf8d0.tar.gz rails-7db80f87e9c194713c2016820e39af6043ddf8d0.tar.bz2 rails-7db80f87e9c194713c2016820e39af6043ddf8d0.zip |
Move AC::UrlRewriter onto route set
Diffstat (limited to 'actionpack/lib/action_controller/test_case.rb')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index c43e560ac1..072d289964 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -335,23 +335,22 @@ module ActionController @request.remote_addr = '208.77.188.166' # example.com end - private - def build_request_uri(action, parameters) - unless @request.env["PATH_INFO"] - options = @controller.__send__(:url_options).merge(parameters) - options.update( - :only_path => true, - :action => action, - :relative_url_root => nil, - :_path_segments => @request.symbolized_path_parameters) - - rewriter = ActionController::UrlRewriter - url, query_string = rewriter.rewrite(@router, options).split("?", 2) - - @request.env["SCRIPT_NAME"] = @controller.config.relative_url_root - @request.env["PATH_INFO"] = url - @request.env["QUERY_STRING"] = query_string || "" + private + def build_request_uri(action, parameters) + unless @request.env["PATH_INFO"] + options = @controller.__send__(:url_options).merge(parameters) + options.update( + :only_path => true, + :action => action, + :relative_url_root => nil, + :_path_segments => @request.symbolized_path_parameters) + + url, query_string = @router.rewrite(options).split("?", 2) + + @request.env["SCRIPT_NAME"] = @controller.config.relative_url_root + @request.env["PATH_INFO"] = url + @request.env["QUERY_STRING"] = query_string || "" + end end end - end end |