diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-09-02 20:41:40 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-09-02 20:41:40 +0000 |
commit | 2b45e2d37093bd035085bddf0f3fa37192a25b5a (patch) | |
tree | a3dd83fec642d0563c00855390d48ec398e7238f | |
parent | c1c659a2de104f17768748d33dbea040cd955aa6 (diff) | |
download | rails-2b45e2d37093bd035085bddf0f3fa37192a25b5a.tar.gz rails-2b45e2d37093bd035085bddf0f3fa37192a25b5a.tar.bz2 rails-2b45e2d37093bd035085bddf0f3fa37192a25b5a.zip |
Add routing tests to assert that RoutingError is raised when conditions aren't met. Closes #6016 [Nathan Witmer]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4907 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index e8a729e8f5..1dc0ebd65b 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Add routing tests to assert that RoutingError is raised when conditions aren't met. Closes #6016 [Nathan Witmer] + * Deprecation: update docs. #5998 [jakob@mentalized.net, Kevin Clark] * Make auto_link parse a greater subset of valid url formats. [Jamis Buck] diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index f44614beb7..05d2a70f1c 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -1381,6 +1381,13 @@ class RouteSetTest < Test::Unit::TestCase request.method = :post assert_nothing_raised { set.recognize(request) } assert_equal("create", request.path_parameters[:action]) + + request.method = :put + assert_nothing_raised { set.recognize(request) } + assert_equal("update", request.path_parameters[:action]) + + request.method = :update + assert_raises(ActionController::RoutingError) { set.recognize(request) } request.path = "/people/5" request.method = :get @@ -1397,6 +1404,10 @@ class RouteSetTest < Test::Unit::TestCase assert_nothing_raised { set.recognize(request) } assert_equal("destroy", request.path_parameters[:action]) assert_equal("5", request.path_parameters[:id]) + + request.method = :post + assert_raises(ActionController::RoutingError) { set.recognize(request) } + ensure Object.send(:remove_const, :PeopleController) end |