aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-09-05 15:59:25 +0200
committerJosé Valim <jose.valim@gmail.com>2010-09-05 15:59:35 +0200
commit8a3461b8c1cb6371c809618420de9e69a71d183f (patch)
tree8497bf27d75cb866c459cb58f8e68a008d759fec /actionpack/test
parent9757bfff9b7fff21697228dd0920d8ea93fae969 (diff)
downloadrails-8a3461b8c1cb6371c809618420de9e69a71d183f.tar.gz
rails-8a3461b8c1cb6371c809618420de9e69a71d183f.tar.bz2
rails-8a3461b8c1cb6371c809618420de9e69a71d183f.zip
Remove a few tests from old router that do not make sense with the new one.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/resources_test.rb54
-rw-r--r--actionpack/test/controller/routing_test.rb16
2 files changed, 3 insertions, 67 deletions
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\+]+/