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.

response.cookies empty in integration test

#3969

Integration test that worked on 2.3.5, now fails on 3.0.0.beta; this test needs to confirm that a cookie has been issued by a given controller, yet 'response.cookies' is a completely empty hash, no matter what I put in at the controller level.

Digging deeper, this appears to only effect cookies set via the new PermanentCookieJar, and quite possibly the SignedCookieJar.

Looking at response.headers shows the cookies as being set, and throwing some puts() statements in at various points in the chain seems to show that only the standard cookie_jar is being hit for cookies. Unfortunately, I've hit the end of my knowledge of Rails internals, and can't seem to find the bit where cookie_jar.write() is called, to update it so that it pulls from all cookie jars, not just the 'first' one.

Reported by Don Werve · February 16th, 2010 @ 04:39 AM

State: wontfix
Milestone: none
Assigned to: josh josh
Importance: Low

Activity

  1. José Valim
    José Valim
    • Assigned user set to josh

    February 16th, 2010 @ 09:45 PM

  2. josh
    josh
    • Assigned user cleared.

    Could you post some more info so we can try to reproduce?

    This maybe a rack-test bug so you want to contact Bryan Helmkamp.

    February 19th, 2010 @ 03:50 PM

  3. Don Werve
    Don Werve
    • Assigned user set to josh

    In the controller:

    def dosomething
        cookies['imacookie'] = 'foo'
        cookies.permanent['imapermanentcookie'] = 'bar'
    end
    

    In the integration test:

     post('/controller/dosomething')
    

    Inspecting 'response.cookies' in the integration test after this shows that 'imacookie' gets set, but 'imapermanentcookie' does not. If I look at the full headers ('response.headers'), then I see 'imapermanentcookie'.

    Rack-test bug?

    March 2nd, 2010 @ 02:10 AM

  4. josh
    josh
    • State changed from new to wontfix

    Sounds like it.

    March 6th, 2010 @ 06:58 PM