Functional tests all come with a handy line that gives more sensible exception reporting, looking something like :
class FooController; def rescue_action(e) raise e end; end
This can cause a few problems. For example, assert_response :missing isn't going to work : the 404 status is no longer set on getting an ActiveRecord::RecordNotFound. Within functional tests, this isn't too bad : you'd probably be content with something like assert_raises(ActiveRecord::RecordNotFound){get 'show', :id => 40000}
However, I'm struggling to deal with this and autotest. AFAICT, autotest doesn't reload the controllers when moving between functional tests and integration tests, so controllers still have the rewritten rescue_action method in integration. So the exception gets caught at dispatcher.rb:42, which always returns a status of 500. The end result is that in autotest's integration testing, you might get 404 or you might get 500, depending on whether or not your functional tests got loaded first on that particular run.
Has anyone found a workaround for this? At the moment I'm having to remove the "def rescue_action(e) raise e end" line from functional tests, and it's making functional test debugging a bit painful...
Jon