diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-08-13 18:31:58 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-08-13 18:31:58 +0000 |
commit | 8c4b599b7c62b85069fa04533e8f06e5476f927a (patch) | |
tree | b65da84b4a6f7f2104a211d8b2f905b92f5389e6 /actionpack/test/controller/action_pack_assertions_test.rb | |
parent | c963f8e955ca5a2d1cc668ee5fa1f7e5f1fba689 (diff) | |
download | rails-8c4b599b7c62b85069fa04533e8f06e5476f927a.tar.gz rails-8c4b599b7c62b85069fa04533e8f06e5476f927a.tar.bz2 rails-8c4b599b7c62b85069fa04533e8f06e5476f927a.zip |
Fix assert_redirected_to issue with named routes for module controllers. [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4757 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/action_pack_assertions_test.rb')
-rw-r--r-- | actionpack/test/controller/action_pack_assertions_test.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index 56b1752392..38aee0077d 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -124,9 +124,18 @@ end module Admin class InnerModuleController < ActionController::Base + def index + render :nothing => true + end + + def redirect_to_index + redirect_to admin_inner_module_path + end + def redirect_to_absolute_controller redirect_to :controller => '/content' end + def redirect_to_fellow_controller redirect_to :controller => 'user' end @@ -267,6 +276,19 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase end end + def test_assert_redirect_to_nested_named_route + with_routing do |set| + set.draw do |map| + map.admin_inner_module 'admin/inner_module', :controller => 'admin/inner_module', :action => 'index' + map.connect ':controller/:action/:id' + end + @controller = Admin::InnerModuleController.new + process :redirect_to_index + # redirection is <{"action"=>"index", "controller"=>"admin/admin/inner_module"}> + assert_redirected_to admin_inner_module_path + end + end + # test the flash-based assertions with something is in the flash def test_flash_assertions_full process :flash_me |