aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing_test.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2010-01-13 11:45:27 -0600
committerJoshua Peek <josh@joshpeek.com>2010-01-13 11:45:27 -0600
commit521ef3c40f34d61d42d092eb39348a1be52ac57d (patch)
tree4dd08c40d4d4a829c085bf730a7420e68864cdac /actionpack/test/dispatch/routing_test.rb
parent01839834fd19e7be1e89309416bed497ac5ea0a0 (diff)
downloadrails-521ef3c40f34d61d42d092eb39348a1be52ac57d.tar.gz
rails-521ef3c40f34d61d42d092eb39348a1be52ac57d.tar.bz2
rails-521ef3c40f34d61d42d092eb39348a1be52ac57d.zip
Passing in a crud action overloads the default action instead of creating a
new member action.
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r--actionpack/test/dispatch/routing_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index bcd6a5278c..61cd2e3007 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -22,6 +22,10 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
delete 'logout' => :destroy, :as => :logout
end
+ resource :session do
+ get :create
+ end
+
match 'account/logout' => redirect("/logout"), :as => :logout_redirect
match 'account/login', :to => redirect("/login")
@@ -170,6 +174,19 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
end
end
+ def test_session_singleton_resource
+ with_test_routes do
+ get '/session'
+ assert_equal 'sessions#create', @response.body
+
+ post '/session'
+ assert_equal 'sessions#create', @response.body
+
+ get '/session/new'
+ assert_equal 'sessions#new', @response.body
+ end
+ end
+
def test_redirect_modulo
with_test_routes do
get '/account/modulo/name'