diff options
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 |