Thursday, October 04, 2012

Testing Cookies

Notes from Rails Cookbook:

To fully test cookies, you need to test that your application is not only setting the cookies, but also correctly reading them when passed in with a request. To do that create Cookie object and add that to the simulated test Request object, which is setup before every test in the setup method.

Rails cookie tests : https://github.com/rails/rails/blob/master/actionpack/test/dispatch/cookies_test.rb