From b38c6d4d73850e31d69528909807a38bbb2de2ca Mon Sep 17 00:00:00 2001 From: Josh Kalderimis Date: Fri, 18 Jun 2010 16:27:14 +0200 Subject: [PATCH] failing test for routes with :only => :create --- actionpack/test/dispatch/routing_test.rb | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index e294703..43f2708 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -142,6 +142,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest resources :comments, :except => :destroy end + resources :users, :only => :create + shallow do namespace :api do resources :teams do @@ -729,6 +731,23 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_resource_routes_only_create + with_test_routes do + post '/users' + assert_equal 'users#create', @response.body + assert_equal '/users', users_path + + get '/users' + assert_equal 'pass', @response.headers['X-Cascade'] + get '/users/1' + assert_equal 'pass', @response.headers['X-Cascade'] + put '/users/1' + assert_equal 'pass', @response.headers['X-Cascade'] + delete '/users/1' + assert_equal 'pass', @response.headers['X-Cascade'] + end + end + def test_resource_with_slugs_in_ids with_test_routes do get '/posts/rails-rocks' -- 1.6.6