diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-12-11 00:01:22 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-12-11 00:01:22 -0600 |
commit | 588225f8852c4b60bfba38f16d8797a41e175400 (patch) | |
tree | e3272d8c2e196b5ac89ab2ccd465cebf521b16d6 /actionpack/test | |
parent | 2f90d700498294a9a4da0baa5317c0e6feaaf176 (diff) | |
download | rails-588225f8852c4b60bfba38f16d8797a41e175400.tar.gz rails-588225f8852c4b60bfba38f16d8797a41e175400.tar.bz2 rails-588225f8852c4b60bfba38f16d8797a41e175400.zip |
Remove fancy method not allowed resource exceptions since they are
too much of a hack
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/resources_test.rb | 8 | ||||
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 9 |
2 files changed, 7 insertions, 10 deletions
diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index 04e9acf855..1a03396ae9 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -403,7 +403,7 @@ class ResourcesTest < ActionController::TestCase with_restful_routing :messages do assert_restful_routes_for :messages do |options| assert_recognizes(options.merge(:action => "new"), :path => "/messages/new", :method => :get) - assert_raise(ActionController::MethodNotAllowed) do + assert_raise(ActionController::RoutingError) do ActionController::Routing::Routes.recognize_path("/messages/new", :method => :post) end end @@ -689,11 +689,11 @@ class ResourcesTest < ActionController::TestCase options = { :controller => controller_name.to_s } collection_path = "/#{controller_name}" - assert_raise(ActionController::MethodNotAllowed) do + assert_raise(ActionController::RoutingError) do assert_recognizes(options.merge(:action => 'update'), :path => collection_path, :method => :put) end - assert_raise(ActionController::MethodNotAllowed) do + assert_raise(ActionController::RoutingError) do assert_recognizes(options.merge(:action => 'destroy'), :path => collection_path, :method => :delete) end end @@ -1378,7 +1378,7 @@ class ResourcesTest < ActionController::TestCase end def assert_not_recognizes(expected_options, path) - assert_raise ActionController::RoutingError, ActionController::MethodNotAllowed, Assertion do + assert_raise ActionController::RoutingError, Assertion do assert_recognizes(expected_options, path) end end diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index d52da58807..a9a970d67d 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -976,7 +976,7 @@ class RouteSetTest < ActiveSupport::TestCase params = set.recognize_path("/people", :method => :put) assert_equal("update", params[:action]) - assert_raise(ActionController::NotImplemented) { + assert_raise(ActionController::RoutingError) { set.recognize_path("/people", :method => :bacon) } @@ -992,12 +992,9 @@ class RouteSetTest < ActiveSupport::TestCase assert_equal("destroy", params[:action]) assert_equal("5", params[:id]) - begin + assert_raise(ActionController::RoutingError) { set.recognize_path("/people/5", :method => :post) - flunk 'Should have raised MethodNotAllowed' - rescue ActionController::MethodNotAllowed => e - assert_equal [:get, :put, :delete], e.allowed_methods - end + } end def test_recognize_with_alias_in_conditions |