aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-12-23 17:42:30 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2009-12-23 17:42:30 -0800
commit4d3602a8c4b38052c70655cd7d9dea42ae10ea8d (patch)
tree8687cdd687cde9ddb27315c1a676901d1d50098a /actionpack/test/dispatch/routing_test.rb
parent1ee50e58f6eb429872dfeabeb0708a8065ff34de (diff)
downloadrails-4d3602a8c4b38052c70655cd7d9dea42ae10ea8d.tar.gz
rails-4d3602a8c4b38052c70655cd7d9dea42ae10ea8d.tar.bz2
rails-4d3602a8c4b38052c70655cd7d9dea42ae10ea8d.zip
Routing: fix that route shorthand shouldn't ignore other options. Raise if :as option is given to root method since its name is always 'root'
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r--actionpack/test/dispatch/routing_test.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index 1c7822358d..7ca85a4201 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -22,7 +22,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
delete 'logout', :to => :destroy, :as => :logout
end
- match 'account/logout' => redirect("/logout")
+ match 'account/logout' => redirect("/logout"), :as => :logout_redirect
match 'account/login', :to => redirect("/login")
match 'account/modulo/:name', :to => redirect("/%{name}s")
@@ -109,7 +109,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
scope ':access_token', :constraints => { :access_token => /\w{5,5}/ } do
resources :rooms
end
-
+
root :to => 'projects#index'
end
end
@@ -153,6 +153,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
def test_logout_redirect_without_to
with_test_routes do
+ assert_equal '/account/logout', logout_redirect_path
get '/account/logout'
assert_equal 301, @response.status
assert_equal 'http://www.example.com/logout', @response.headers['Location']
@@ -462,6 +463,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
def test_root
with_test_routes do
+ assert_equal '/', root_path
get '/'
assert_equal 'projects#index', @response.body
end