DEV Community

Discussion on: Testing signed and encrypted cookies in Rails

Collapse
 
chaadow profile image
Chad Lee B.

Alright! I'm currently in the process of refactoring some tests using minitest (with Rails), will let you know what would potentially work for me (hopefully).

I've spelunked the rails code source, #cookies in minitest always refers to the request's cookies ( even after the HTTP call), and is a Rack::Test::CookieJar instance, whereas response.cookies is a plain ruby hash containing the responses's cookies. I'm going to instantiate a rails Cookie Jar as suggested in your article, but using response.cookies as the second argument.