After searching, can't find the answer to this simple question. Yes, I read the Guides many times.
Here's what I got so far.
test "there开发者_如何转开发 is no route for this request" do
assert_raise(Exception) {
post :the_route
}
end
The browser shows
Are there any resources that explain the basics of testing (besides the Guides)?
Thanks.
Have you looked into the routing assertions at all? They could be what you're looking for. Most app's I've worked on have at least one "routes_test". check them out here:
http://api.rubyonrails.org/classes/ActionDispatch/Assertions/RoutingAssertions.html
精彩评论