From 184ef28f55bb576e1eaebf915f8ce64aa8823e90 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Fri, 15 Jan 2010 14:53:54 -0600 Subject: Routing method shorthand shouldn't clobber :to options --- actionpack/test/dispatch/routing_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 87d8d7730a..2fcc5fef35 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -97,6 +97,13 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + resources :replies do + member do + put :answer, :to => :mark_as_answer + delete :answer, :to => :unmark_as_answer + end + end + resources :posts, :only => [:index, :show] match 'sprockets.js' => ::TestRoutingMapper::SprocketsApp @@ -437,6 +444,16 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_replies + with_test_routes do + put '/replies/1/answer' + assert_equal 'replies#mark_as_answer', @response.body + + delete '/replies/1/answer' + assert_equal 'replies#unmark_as_answer', @response.body + end + end + def test_posts with_test_routes do get '/posts' -- cgit v1.2.3