ruby on rails - How do you test the expiration date on a cookie? -


how can access expiration time on cookie in functional test? example:

assert cookies.signed[:cart_id].expires > time.now 

that throw error because cookies[:cart_id] returns integer.

according answer, , many other pages found on web while looking solution this, not possible. it's not issue rails, it's issue how web (dom) works.

you don't need test cookie expiry, web browser you. can poll cookie; if it's expired, won't exist, , value returned either nil or you'll exception, haven't tested myself.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -