• A
    Refactor ActionController::TestCase cookies · d4658d86
    Andrew White 提交于
    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.
    d4658d86
test_case.rb 19.0 KB