aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2010-07-15 01:18:02 +0200
committerPiotr Sarnacki <drogus@gmail.com>2010-09-03 22:59:07 +0200
commite9791bec823e42372eca095b946c93c1712a0613 (patch)
tree8dc4f12b6c4646bdce775b58a8eca5721317b4d4 /railties/test
parent229a868264a1dd5f4441f4b82ccf2a51cf83511d (diff)
downloadrails-e9791bec823e42372eca095b946c93c1712a0613.tar.gz
rails-e9791bec823e42372eca095b946c93c1712a0613.tar.bz2
rails-e9791bec823e42372eca095b946c93c1712a0613.zip
Routes refactoring:
* added more tests for prefix generation * fixed bug with generating host for both prefix and url * refactored url_for method * organized tests for prefix generation
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/railties/mounted_engine_test.rb (renamed from railties/test/railties/mounted_engine_routes_test.rb)11
1 files changed, 6 insertions, 5 deletions
diff --git a/railties/test/railties/mounted_engine_routes_test.rb b/railties/test/railties/mounted_engine_test.rb
index 319b99383c..87bcf9b1f3 100644
--- a/railties/test/railties/mounted_engine_routes_test.rb
+++ b/railties/test/railties/mounted_engine_test.rb
@@ -50,10 +50,10 @@ module ApplicationTests
end
def generate_application_route
- path = url_for( :routes => Rails.application.routes,
- :controller => "main",
- :action => "index",
- :only_path => true)
+ path = url_for(Rails.application,
+ :controller => "main",
+ :action => "index",
+ :only_path => true)
render :text => path
end
end
@@ -66,7 +66,7 @@ module ApplicationTests
end
def url_for_engine_route
- render :text => url_for(:controller => "posts", :action => "index", :user => "john", :only_path => true, :routes => Blog::Engine.routes)
+ render :text => url_for(Blog::Engine, :controller => "posts", :action => "index", :user => "john", :only_path => true)
end
end
RUBY
@@ -110,6 +110,7 @@ module ApplicationTests
script_name "/foo"
get "/engine_route", {}, 'SCRIPT_NAME' => "/foo"
assert_equal "/foo/anonymous/blog/posts", last_response.body
+
script_name "/foo"
get "/url_for_engine_route", {}, 'SCRIPT_NAME' => "/foo"
assert_equal "/foo/john/blog/posts", last_response.body