我有一个自定义的错误页面在我的rails应用程序测试404错误似乎足够直接(获取不存在的页面,并为assert_match /选择某些文本),但我想知道如何测试500错误页面.
有任何想法吗?
解决方法
所以我发现,我可以在rspec中做这样的事情
def other_error raise "ouch!" end it "renders 500 on Runtime error" do get :other_error response.should render_template("errors/500") response.status.should == 500 end