This project is archived and is in readonly mode.

#3969 ✓wontfix
Don Werve

response.cookies empty in integration test

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

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.

Comments and changes to this ticket

  • José Valim

    José Valim February 16th, 2010 @ 09:45 PM

    • Assigned user set to “josh”
  • josh

    josh February 19th, 2010 @ 03:50 PM

    • 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.

  • Don Werve

    Don Werve March 2nd, 2010 @ 02:10 AM

    • 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?

  • josh

    josh March 6th, 2010 @ 06:58 PM

    • State changed from “new” to “wontfix”

    Sounds like it.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages