Rails 3.1.4 アプリでは、アプリケーション コントローラーrspecのパブリック メソッドをテストするために使用されます。require_signinメソッドrequire_signinは次のとおりです。
def require_signin
if !signed_in?
flash.now.alert = "Log in first!"
redirect_to signin_path
end
end
rspecコードは次のとおりです。
it "should invoke require_signin for those without login" do
controller.send(:require_signin)
controller {should redirect_to signin_path}
end
上記rspecは、以下のような巨大な複数ページ エラーを生成します。
RuntimeError:←[0m
←[31mActionController::RackDelegation#status= delegated to @_response.status=, but @_response is nil: #<ApplicationController:0x3
a67f10 @_routes=nil, @_action_has_layout=true, @_view_context_class=nil, @_headers={"Content-Type"=>"text/html"}, @_status=200, @_reques
t=#<ActionController::TestRequest:0x3a68720 @env={"rack.version"=>[1, 1], "rack.input"=>#<StringIO:0x34fad60>, ........
rspecコードのどこが間違っている可能性がありますか? 本当にありがとう。