From dcaa074abf5691a933b9c55159cc7d98a02b3b2f Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 26 May 2007 20:07:34 +0000 Subject: Routing: respond with 405 Method Not Allowed status when the route path matches but the HTTP method does not. Closes #6953. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6862 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/resources_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/test/controller/resources_test.rb') diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index 60d94120af..8149c02a9d 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -188,7 +188,7 @@ class ResourcesTest < Test::Unit::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_raises(ActionController::RoutingError) do + assert_raises(ActionController::MethodNotAllowed) do ActionController::Routing::Routes.recognize_path("/messages/new", :method => :post) end end @@ -384,11 +384,11 @@ class ResourcesTest < Test::Unit::TestCase options = { :controller => controller_name.to_s } collection_path = "/#{controller_name}" - assert_raises(ActionController::RoutingError) do + assert_raises(ActionController::MethodNotAllowed) do assert_recognizes(options.merge(:action => 'update'), :path => collection_path, :method => :put) end - assert_raises(ActionController::RoutingError) do + assert_raises(ActionController::MethodNotAllowed) do assert_recognizes(options.merge(:action => 'destroy'), :path => collection_path, :method => :delete) end end -- cgit v1.2.3