Results 1 to 1 of 1
May 9, 2006, 11:24 #1
- Join Date
- May 2002
- 0 Post(s)
- 0 Thread(s)
Functional Testing: Ensure bad route doesn't work
I'm trying to test for bad routes. For example, I have the route:
map.connect ':platform_filter/:software/:version/:platform', :controller => 'user/version', :platform_filter => /all/, :platform => /windows|macintosh|unix|linux/, :action => 'show'
However, if someone punches in: somehost.com/all/matlab/r2006a/crap
the above mapping will fail and my page_not_found mapping catches it
map.connect '*anything', :controller => 'user/home_page', :action => 'page_not_found'
So here is my question, in my test, I want to confirm that if the above "bogus" url
gets punched in, the default route is the one that is matched. I've checked assert_generates(), assert_recognizes(), and assert_routing(). None of these seem to be able to test for this. If anyone can help that would be awesome.