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

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -