Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Tests should see all cookies, not just those that are created or changed in the controller

#2768

This test passes, even when the controller hasn't deleted the cookie. That's because cookies in a test case are only built up from the response and ignore the request.

def test_should_delete_the_cookie
@request.cookies['foo'] = 'bar get :do_something assert_nil cookies['foo'] end

Reported by Craig Smith · June 5th, 2009 @ 04:16 PM

State: committed
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Repository
    Repository
    • State changed from new to committed

    (from [316f4704eaa8aaba11e7ecebc1da9aa926fdd2d0]) Test cases should see all the cookies, not just cookies that have been set in the controller.

    Previously this example would always pass, even when cookies.delete was not called.

    @request.cookies['foo'] = 'bar' get :delete_cookie
    assert_nil cookies['foo']

    Signed-off-by: Michael Koziarski michael@koziarski.com
    [#2768 Tests should see all cookies, not just those that are created or changed in t... state:committed] http://github.com/rails/rails/commit/316f4704eaa8aaba11e7ecebc1da9a...

    October 14th, 2009 @ 10:59 PM