diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2005-07-07 19:51:20 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2005-07-07 19:51:20 +0000 |
commit | f4bfacb24fbe17c1010a46c2b2d7a15d44cf1918 (patch) | |
tree | 02115c51afe9fe9b73e995b4efd726503f813323 /actionpack/test/controller | |
parent | 5727dc2f42874e32f8cac3c176a085de07b24dd9 (diff) | |
download | rails-f4bfacb24fbe17c1010a46c2b2d7a15d44cf1918.tar.gz rails-f4bfacb24fbe17c1010a46c2b2d7a15d44cf1918.tar.bz2 rails-f4bfacb24fbe17c1010a46c2b2d7a15d44cf1918.zip |
Enable routes to recognize uppercase controller names. Closes #1635
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1765 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 38b995dc6e..93d16c6f65 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -109,6 +109,9 @@ module Object::Controllers class UserController end + + class NewsFeedController + end end end @@ -718,6 +721,15 @@ class RouteSetTests < Test::Unit::TestCase def test_action_expiry assert_equal ['/content', {}], rs.generate({:controller => 'content'}, {:controller => 'content', :action => 'show'}) end + + def test_recognition_with_uppercase_controller_name + assert_equal({'controller' => ::Controllers::ContentController, 'action' => 'index'}, rs.recognize_path(%w(Content))) + assert_equal({'controller' => ::Controllers::ContentController, 'action' => 'list'}, rs.recognize_path(%w(Content list))) + assert_equal({'controller' => ::Controllers::ContentController, 'action' => 'show', 'id' => '10'}, rs.recognize_path(%w(Content show 10))) + + assert_equal({'controller' => ::Controllers::Admin::NewsFeedController, 'action' => 'index'}, rs.recognize_path(%w(Admin NewsFeed))) + assert_equal({'controller' => ::Controllers::Admin::NewsFeedController, 'action' => 'index'}, rs.recognize_path(%w(Admin News_Feed))) + end end end |