I used to rescue an Exception like this:
rescue_from Exception, :with => :render_error
But this is hard to test.
So I removed the condition in the controller and added it in the render_error method itself: raise e if request.local?
And in my test I overwrite ActionDispatch::Request
def local? ; false end
What do you think?