1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix that routes werent being loaded in production environment

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@642 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-02-17 02:04:37 +00:00
parent ead404ccd0
commit 6a48e89ae7
2 changed files with 9 additions and 1 deletions

View file

@ -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:

View file

@ -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'