Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix routes generation for unit tests. #1434

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1497 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 28012e68fe2837207a9319a24c541eabfc5b3ff7 1 parent 8e56f5e
Jeremy Kemper jeremy authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 actionpack/lib/action_controller/routing.rb
10 actionpack/lib/action_controller/routing.rb
View
@@ -383,6 +383,10 @@ def generate(options, request_or_recall_hash = {})
def generate_path(merged, options, expire_on)
send @generation_methods[merged[:controller]], merged, options, expire_on
end
+ def generate_default_path(*args)
+ write_generation
+ generate_default_path(*args)
+ end
def write_generation
@generation_methods = Hash.new(:generate_default_path)
@@ -499,7 +503,11 @@ def known_controllers
def reload
NamedRoutes.clear
- load(File.join(RAILS_ROOT, 'config', 'routes.rb'))
+
+ if defined?(RAILS_ROOT) then load(File.join(RAILS_ROOT, 'config', 'routes.rb'))
+ else connect(':controller/:action/:id', :action => 'index', :id => nil)
+ end
+
NamedRoutes.install
end
Please sign in to comment.
Something went wrong with that request. Please try again.