From 8a3461b8c1cb6371c809618420de9e69a71d183f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 5 Sep 2010 15:59:25 +0200 Subject: Remove a few tests from old router that do not make sense with the new one. --- actionpack/test/controller/resources_test.rb | 54 ++-------------------------- actionpack/test/controller/routing_test.rb | 16 --------- 2 files changed, 3 insertions(+), 67 deletions(-) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index 70d2ecdc3f..b59fd65a3e 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -301,28 +301,6 @@ class ResourcesTest < ActionController::TestCase end end - # def test_member_when_changed_default_restful_actions_and_path_names_not_specified - # default_path_names = ActionController::Base.resources_path_names - # ActionController::Base.resources_path_names = {:new => 'nuevo', :edit => 'editar'} - # - # with_restful_routing :messages do - # new_options = { :action => 'new', :controller => 'messages' } - # new_path = "/messages/nuevo" - # edit_options = { :action => 'edit', :id => '1', :controller => 'messages' } - # edit_path = "/messages/1/editar" - # - # assert_restful_routes_for :messages do |options| - # assert_recognizes(options.merge(new_options), :path => new_path, :method => :get) - # end - # - # assert_restful_routes_for :messages do |options| - # assert_recognizes(options.merge(edit_options), :path => edit_path, :method => :get) - # end - # end - # ensure - # ActionController::Base.resources_path_names = default_path_names - # end - def test_with_two_member_actions_with_same_method [:put, :post].each do |method| with_routing do |set| @@ -680,32 +658,6 @@ class ResourcesTest < ActionController::TestCase end end - def test_should_not_allow_invalid_head_method_for_member_routes - with_routing do |set| - assert_raise(ArgumentError) do - set.draw do - resources :messages do - match :something, :on => :member, :via => :head - end - end - end - end - end - - def test_should_not_allow_invalid_http_methods_for_member_routes - with_routing do |set| - assert_raise(ArgumentError) do - set.draw do - resources :messages do - member do - match :something, :via => [:invalid, :get] - end - end - end - end - end - end - def test_resource_action_separator with_routing do |set| set.draw do @@ -1009,7 +961,7 @@ class ResourcesTest < ActionController::TestCase def test_resource_has_only_collection_action with_routing do |set| set.draw do - resources :products, :except => :all do + resources :products, :only => [] do get :sale, :on => :collection end end @@ -1025,7 +977,7 @@ class ResourcesTest < ActionController::TestCase def test_resource_has_only_member_action with_routing do |set| set.draw do - resources :products, :except => :all do + resources :products, :only => [] do get :preview, :on => :member end end @@ -1041,7 +993,7 @@ class ResourcesTest < ActionController::TestCase def test_singleton_resource_has_only_member_action with_routing do |set| set.draw do - resource :account, :except => :all do + resource :account, :only => [] do member do get :signup end diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 141feae87b..bb990586f7 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -862,14 +862,6 @@ class RouteSetTest < ActiveSupport::TestCase end end - def test_route_constraints_with_invalid_http_method_is_invalid - assert_raise ArgumentError do - set.draw do - match 'valid/route' => 'pages#show', :via => :invalid - end - end - end - def test_route_constraints_with_options_method_condition_is_valid assert_nothing_raised do set.draw do @@ -878,14 +870,6 @@ class RouteSetTest < ActiveSupport::TestCase end end - def test_route_constraints_with_head_method_condition_is_invalid - assert_raise ArgumentError do - set.draw do - match 'valid/route' => 'pages#show', :via => :head - end - end - end - def test_recognize_with_encoded_id_and_regex set.draw do match 'page/:id' => 'pages#show', :id => /[a-zA-Z0-9\+]+/ -- cgit v1.2.3