diff options
author | Diego Carrion <dc.rec1@gmail.com> | 2010-04-16 20:04:29 -0300 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-04-17 17:53:08 -0700 |
commit | 8c7e8976e97d96f514e22b04fc1afb9453134076 (patch) | |
tree | d1ec3e09d05b3c9aff260f4e0f489b8db78cf1da /actionpack/test | |
parent | afcd252205d84ebf5ffd0659301c604a7beba2bb (diff) | |
download | rails-8c7e8976e97d96f514e22b04fc1afb9453134076.tar.gz rails-8c7e8976e97d96f514e22b04fc1afb9453134076.tar.bz2 rails-8c7e8976e97d96f514e22b04fc1afb9453134076.zip |
added shorthand support for routes like /projects/status(.:format)
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 8940990712..5bca476b27 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -54,6 +54,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest match "/local/:action", :controller => "local" + match "/projects/status(.:format)" + constraints(:ip => /192\.168\.1\.\d\d\d/) do get 'admin' => "queenbee#index" end @@ -426,6 +428,13 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_projects_status + with_test_routes do + assert_equal '/projects/status', url_for(:controller => 'projects', :action => 'status', :only_path => true) + assert_equal '/projects/status.json', url_for(:controller => 'projects', :action => 'status', :format => 'json', :only_path => true) + end + end + def test_projects with_test_routes do get '/projects' |