1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test
Andrew White e864ff7259 Add backward compatibility for testing cookies
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.
2011-06-05 12:34:27 +01:00
..
abstract removing usesless variable assignments 2011-01-18 15:52:56 -08:00
activerecord Take into account time spent in AR even if a redirect occurs or if it is after the render 2011-05-23 10:58:43 +01:00
controller Refactor ActionController::TestCase cookies 2011-06-04 07:09:11 +01:00
dispatch Add backward compatibility for testing cookies 2011-06-05 12:34:27 +01:00
fixtures Allow multiple sources in Sprockets helpers 2011-06-05 01:01:35 -05:00
lib Fix tests on 1.9.2. 2010-11-28 12:48:50 +01:00
template Allow multiple sources in Sprockets helpers 2011-06-05 01:01:35 -05:00
tmp Use safe tmp dir 2009-08-13 21:03:25 -05:00
abstract_unit.rb We don't need to load version any more as Sprockets.beta8 is included. 2011-05-23 07:09:09 +05:30
active_record_unit.rb Autoload AR test case 2010-01-04 16:50:01 -06:00
ts_isolated.rb Give useful test:isolated failures 2009-11-04 12:44:06 -08:00