1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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
This commit is contained in:
Rick Olson 2006-09-02 20:41:40 +00:00
parent c1c659a2de
commit 2b45e2d370
2 changed files with 13 additions and 0 deletions

View file

@ -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]

View file

@ -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