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
Post a Comment