diff options
author | Michael Koziarski <michael@koziarski.com> | 2008-01-26 08:41:19 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-01-26 08:41:19 +0000 |
commit | 6e165b894051a23c2818cb8d21dd74de8d41c622 (patch) | |
tree | 04054b28ad0f83e843336c5d4bd7f46f06fd5cd7 /actionpack/test | |
parent | 07132865d69cda80feba26827d3de9fe19365876 (diff) | |
download | rails-6e165b894051a23c2818cb8d21dd74de8d41c622.tar.gz rails-6e165b894051a23c2818cb8d21dd74de8d41c622.tar.bz2 rails-6e165b894051a23c2818cb8d21dd74de8d41c622.zip |
Make it simpler to make the root route an alias for another route. Closes #10818 [bscofield]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8738 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 73b1fa55e8..38a0aa7bdc 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -1808,6 +1808,30 @@ class RouteSetTest < Test::Unit::TestCase Object.send(:remove_const, :PeopleController) end + def test_recognize_with_alias_in_conditions + Object.const_set(:PeopleController, Class.new) + + set.draw do |map| + map.people "/people", :controller => 'people', :action => "index", + :conditions => { :method => :get } + map.root :people + end + + request.path = "/people" + request.method = :get + assert_nothing_raised { set.recognize(request) } + assert_equal("people", request.path_parameters[:controller]) + assert_equal("index", request.path_parameters[:action]) + + request.path = "/" + request.method = :get + assert_nothing_raised { set.recognize(request) } + assert_equal("people", request.path_parameters[:controller]) + assert_equal("index", request.path_parameters[:action]) + ensure + Object.send(:remove_const, :PeopleController) + end + def test_typo_recognition Object.const_set(:ArticlesController, Class.new) |