How can one get a hand on responses of a Rails application to arbitrary
requests to perform tests?
So far I found a testing method
assert_routing
but I feel a direct test may be more robust
I’d rather look at the response directly, such as
get ‘this/url/doesn’t/exist’
assert_equal @response.headers[‘Status’], ‘404’
get ‘this!/!ur\l/doesn’t/exist’
assert_equal @response.headers[‘Status’], ‘404’
maybe even
assert_template :controller => ‘error_handler’, :action => ‘error_page’
– without specifying any controller.
Thanks
Stephan