aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/routing.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2005-06-24 17:48:14 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2005-06-24 17:48:14 +0000
commit28012e68fe2837207a9319a24c541eabfc5b3ff7 (patch)
tree3a9f4eb93648902ca6c472a85d5f795b2eca8ab1 /actionpack/lib/action_controller/routing.rb
parent8e56f5ea3e5394caa2ffee466a7395876c288c2a (diff)
downloadrails-28012e68fe2837207a9319a24c541eabfc5b3ff7.tar.gz
rails-28012e68fe2837207a9319a24c541eabfc5b3ff7.tar.bz2
rails-28012e68fe2837207a9319a24c541eabfc5b3ff7.zip
Fix routes generation for unit tests. #1434
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1497 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/routing.rb')
-rw-r--r--actionpack/lib/action_controller/routing.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb
index 12464f9dcf..a402ddf1a3 100644
--- a/actionpack/lib/action_controller/routing.rb
+++ b/actionpack/lib/action_controller/routing.rb
@@ -383,6 +383,10 @@ module ActionController
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 @@ module ActionController
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