Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jul 25, 2013
  1. @pixeltrix

    Allow overriding of all headers from passed environment hash

    pixeltrix authored
    Allow REMOTE_ADDR, HTTP_HOST and HTTP_USER_AGENT to be overridden from
    the environment passed into `ActionDispatch::TestRequest.new`.
    
    Fixes #11590
Commits on Aug 2, 2012
  1. @fxn
Commits on Jul 4, 2012
  1. @tenderlove

    make the default environment have actual defaults

    tenderlove authored
    instead of deleting keys on every instantiation, create defaults we
    actually use.  eventually we can pass an environment in to the request,
    and create a new req / res object on each call.
Commits on May 21, 2012
  1. @marcandre
Commits on Mar 31, 2012
  1. @spastorino

    Remove not needed requires

    spastorino authored
Commits on Jun 5, 2011
  1. @pixeltrix

    Add backward compatibility for testing cookies

    pixeltrix authored
    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.
Commits on Jun 4, 2011
  1. @pixeltrix

    Refactor ActionController::TestCase cookies

    pixeltrix authored
    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.
Commits on Mar 6, 2011
  1. @pixeltrix

    Improve testing of cookies in functional tests:

    pixeltrix authored
    - 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]
Commits on Sep 27, 2010
  1. @miloops

    Initialize @cookies.

    miloops authored
  2. @miloops
Commits on Sep 3, 2010
  1. @drogus
Commits on Apr 5, 2010
  1. @josevalim

    Rename config.cookie_secret to config.secret_token and pass it as con…

    josevalim authored
    …figuration in request.env. This is another step forward removing global configuration.
Commits on Mar 28, 2010
  1. @fxn
Commits on May 2, 2009
  1. @josh
Commits on May 1, 2009
  1. @josh
  2. @josh
Commits on Apr 30, 2009
  1. @josh
Something went wrong with that request. Please try again.