Testing signed cookies in rails -


i'm using signed cookies in rails 3 enable "remember-me" feature in application. works except i'm not able functional test cookies, since comparing cookies['remember_id'] gives me encrypted cookie, , cookies.signed not defined.

any clues?

the problem (at least on surface) in context of functional test (actioncontroller::testcase), "cookies" object hash, whereas when work controllers, it's actiondispatch::cookies::cookiejar object. need convert cookiejar object can use "signed" method on convert signedcookiejar.

you can put following functional tests (after request) convert cookies hash cookiejar object

@request.cookies.merge!(cookies) cookies = actiondispatch::cookies::cookiejar.build(@request) 

Comments

Popular posts from this blog

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -

python - Does anyone know how to configure the hunpos wrapper class on nltk? -