は、サーバは、クッキー(資格情報といくつかのアプリのCookie)私を送り返す:テスト応答クッキーが
Response sent 170 bytes of Cookie data:
Set-Cookie: user_credentials=val; path=/; HttpOnly; Secure
Response sent 554 bytes of Cookie data:
Set-Cookie: _app_session=otherVal; path=/; HttpOnly; Secure
を...そしてホームページにリダイレクトします。
Cookieにはいくつかのフラグが含まれています。 httpOnly
,Secure
など
クッキーにRspecのフラグが含まれているかどうかをテストするにはどうすればよいですか?
少なくとも、これらのクッキーはどこにありますか?
it "should generate cookies with proper flags" do
params = Factory.attributes_for(:user,
:username => "uname",
:password => "upass"
)
# login
post 'create', params
response.should redirect_to home_url # => pass
puts "response cookie = #{response.cookies.inspect}" # => {} // no cookies in response, why?
end
実際には「カピバラ」は仕事の範囲外ですが、まだありがとうございます。 – ted
クッキーはどのように設定されていますか?コントローラーでそれをやっていますか? – severin
それらのうちの1つは 'Authlogic'の宝石によって設定され、もう1つは' ActionController'のものです – ted