From 28016d33b0f2e668ca59a912c7fb2d777e3cf0a3 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 1 Jul 2010 09:04:30 +0200 Subject: Use env['action_dispatch.routes'] to determine if we should generate prefix or not. This technique is here to allow using routes from Engine in Application and vice versa. When using Engine routes inside Application it should generate prefix based on mount point. When using Engine routes inside Engine it should use env['SCRIPT_NAME']. In any other case it should generate prefix as env should not be even available. --- actionpack/test/controller/routing_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index a8c74a6064..1f14607c31 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -251,7 +251,7 @@ class LegacyRouteSetTests < Test::Unit::TestCase map.pages 'pages', :controller => 'content', :action => 'show_page', :host => 'foo.com' end x = setup_for_named_route - x.expects(:url_for).with(:host => 'foo.com', :only_path => false, :controller => 'content', :action => 'show_page', :use_route => :pages).once + x.expects(:url_for).with(:host => 'foo.com', :only_path => false, :controller => 'content', :action => 'show_page', :use_route => :pages, :router => rs).once x.send(:pages_url) end -- cgit v1.2.3