aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing_test.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-05-19 23:29:39 +0200
committerXavier Noria <fxn@hashref.com>2010-05-19 23:29:39 +0200
commit7f07cc364a7ee7ceae21b29b54467fde0db93389 (patch)
tree7c9dd8aaeda68731756ee108a8318239b04c80f0 /actionpack/test/dispatch/routing_test.rb
parentb9fcd8d71f94702463b97545bb70ce4727c5b47e (diff)
parent61001e766de974a8864c0bc2cf915888d277a0ea (diff)
downloadrails-7f07cc364a7ee7ceae21b29b54467fde0db93389.tar.gz
rails-7f07cc364a7ee7ceae21b29b54467fde0db93389.tar.bz2
rails-7f07cc364a7ee7ceae21b29b54467fde0db93389.zip
Merge remote branch 'rails/master'
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r--actionpack/test/dispatch/routing_test.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index 651a7a6be0..180889ddf2 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -186,6 +186,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
end
resources :products, :constraints => { :id => /\d{4}/ } do
+ root :to => "products#root"
+ get :favorite, :on => :collection
resources :images
end
@@ -963,7 +965,9 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
get '/products/1'
assert_equal 'pass', @response.headers['X-Cascade']
get '/products'
- assert_equal 'products#index', @response.body
+ assert_equal 'products#root', @response.body
+ get '/products/favorite'
+ assert_equal 'products#favorite', @response.body
get '/products/0001'
assert_equal 'products#show', @response.body
@@ -981,6 +985,12 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
end
end
+ def test_root_works_in_the_resources_scope
+ get '/products'
+ assert_equal 'products#root', @response.body
+ assert_equal '/products', products_root_path
+ end
+
def test_module_scope
with_test_routes do
get '/token'