アクションに次のコードがあります。
render :file => 'public/404.html' and return
これはブラウザで正常に動作します。これをテストするために、次の rspec の例を作成しました。
it "renders 404" do
get :new
response.should render_template('public/404.html')
end
この例を実行すると、次のエラーが発生します。
Failure/Error: response.should render_template('public/404.html')
Expected block to return true value.
私も試しresponse.should render_template(:file => 'public/404.html')
ましたが、それもエラーになります。
これをどのようにテストすればよいですか?