We would need to use response.cookies. No need to add .to_hash because response.cookies is already a hash.
Unlike Rspec, cookies in Minitest ( or Rails custom version of minitest) always refer to the request cookies which is an instance of Rack::Test::CookieJar
Update: I've figured out how to make it work in my tests ( was having weird issues but application related, not rails related)
Basically to make this work in Rails/minitest, one would do:
We would need to use
response.cookies
. No need to add.to_hash
because response.cookies is already a hash.Unlike Rspec,
cookies
in Minitest ( or Rails custom version of minitest) always refer to the request cookies which is an instance ofRack::Test::CookieJar
This is the answer I have been looking for. I had originally used
But realised late on that the cookies.to_hash was empty as I never set cookies in Rack::Test::CookieJar
Thank you for this