aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/cookies_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add has_key? and key? methods to CookieJar removed in 0ca69ca65f83b4bb34f8José Valim2011-06-301-0/+9
|
* Add backward compatibility for testing cookiesAndrew White2011-06-051-2/+49
| | | | | | | | | | | | | | | | | | | This commit restores the ability to assign cookies for testing via @request.env['HTTP_COOKIE'] and @request.cookies, e.g: @request.env['HTTP_COOKIE'] = 'user_name=david' get :index assert_equal 'david', cookies[:user_name] and @request.cookies[:user_name] = 'david' get :index assert_equal 'david', cookies[:user_name] Assigning via cookies[] is the preferred method and will take precedence over the other two methods. This is so that cookies set in controller actions have precedence and are carried over between calls to get, post, etc.
* Refactor ActionController::TestCase cookiesAndrew White2011-06-041-18/+12
| | | | | | | | | | | | | | | | | | Assigning cookies for test cases should now use cookies[], e.g: cookies[:email] = 'user@example.com' get :index assert_equal 'user@example.com', cookies[:email] To clear the cookies, use clear, e.g: cookies.clear get :index assert_nil cookies[:email] We now no longer write out HTTP_COOKIE and the cookie jar is persistent between requests so if you need to manipulate the environment for your test you need to do it before the cookie jar is created.
* adding teststeve2011-05-191-4/+8
|
* Revert "Use freeze instead of close!"Santiago Pastorino2011-04-071-6/+0
| | | | This reverts commit 29592a7f09dda2e7e1e0a915d9230fe6a9b5c0af.
* cookies hereSantiago Pastorino2011-04-071-3/+3
|
* Use freeze instead of close!Santiago Pastorino2011-04-061-0/+6
|
* Delete useless argumentsSantiago Pastorino2011-04-061-6/+6
|
* Delete useless env variableSantiago Pastorino2011-04-061-9/+3
|
* Add tests to verify that signed and permanent cookies raises if someone triesSantiago Pastorino2011-04-061-0/+51
| | | | | to modify the cookies when it was already streamed back to the client or converted to HTTP headers
* raise if someone tries to modify the cookies when it was already streamed ↵Santiago Pastorino2011-04-061-0/+51
| | | | back to the client or converted to HTTP headers
* Improve testing of cookies in functional tests:Andrew White2011-03-061-0/+65
| | | | | | | | | - cookies can be set using string or symbol keys - cookies are preserved across calls to get, post, etc. - cookie names and values are escaped - cookies can be cleared using @request.cookies.clear [#6272 state:resolved]
* Add tld_length option when using domain :all in cookiesbrainopia2011-01-211-0/+36
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Support list of possible domains for cookiesbrainopia2011-01-211-0/+45
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix edge cases for domain :all option on cookie storebrainopia2010-12-161-0/+21
| | | | | | | | Dont set explicit domain for cookies if host is not a domain name [#6002 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Make cookies hash in ActionDispatch::TestProcess indifferent access [#5761 ↵David Trasbo2010-11-071-0/+18
| | | | | | state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Don't write out secure cookies unless the request is secureAndrew White2010-10-251-0/+23
|
* Use parentheses when using assert_match followed by a regexp to avoid warnings.Emilio Tagua2010-09-271-5/+5
|
* Only send secure cookies over SSL.W. Andrew Loe III2010-09-131-0/+11
|
* Allow for any possible TLD when using the :all option with the cookie ↵Bryce Thornton2010-08-151-1/+29
| | | | | | session store. This works for subdomain.mysite.local, google.co.uk, google.com.au, etc. [#5147 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Added tests for cookies with domain option.Rizwan Reza2010-06-111-0/+22
|
* Moved test/controller/cookie_test.rb to test/dispatch/cookies_test.rbRizwan Reza2010-06-111-0/+228