The problem (at least on the surface) is that in the context of the functional test (ActionController :: TestCase) the cookie is a hash, while when working with controllers it is ActionDispatch :: cookies :: CookieJar. Therefore, we need to convert it to a CookieJar so that we can use the βsignedβ method to convert it to a SignedCookieJar.
In your functional tests (after a request for receipt) you can put the following files to convert cookies from a Hash to a CookieJar.
@request.cookies.merge!(cookies) cookies = ActionDispatch::Cookies::CookieJar.build(@request)
source share