diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/routing.rb | 3 | ||||
-rw-r--r-- | actionpack/test/controller/routing_tests.rb | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 7ea8f5be5e..6c3b73843c 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -237,7 +237,8 @@ module ActionController alias :connect :route def reload - begin require_dependency(ROUTE_FILE) + begin + require_dependency(ROUTE_FILE) if Object.method_defined?(:require_dependency) rescue LoadError, ScriptError => e raise RoutingError, "Cannot load config/routes.rb:\n #{e.message}" ensure # Ensure that there is at least one route: diff --git a/actionpack/test/controller/routing_tests.rb b/actionpack/test/controller/routing_tests.rb index 5a8df3a3f4..821e66af70 100644 --- a/actionpack/test/controller/routing_tests.rb +++ b/actionpack/test/controller/routing_tests.rb @@ -403,6 +403,13 @@ class RouteSetTests < Test::Unit::TestCase @set.connect ':action/:controller' verify_generate('index/resource', options) end + + def test_action_dropped_when_controller_given + @request.path_parameters = {:controller => 'content', :action => 'list'} + options = {:controller => 'content'} + @set.connect ':action/:controller' + verify_generate('index/content', options) + end end #require '../assertions/action_pack_assertions.rb' |