This project is archived and is in readonly mode.

#6272 ✓resolved
Marko Anastasov

Cookie value set in functional test, key present in controller but unreadable

Reported by Marko Anastasov | January 10th, 2011 @ 02:19 PM | in 3.0.6

Initially I posted a message on rspec-users, but was told[0] that this sounds like a Rails bug.

I set a value in controller spec using @request.cookies:
https://gist.github.com/371356ba0a19666fd3b5

but when the controller reads it, it's nil somehow, even though the key is present, as this screenshot from the debugger shows:
http://dl.dropbox.com/u/830772/p/Selection_033.jpeg

This happens in test environment only. Eventually I figured out that I can use request.cookies in controller to make it work. But it's strange that I need to.

I'm using RSpec 2.4 and Rails 3.0.3.

[0] http://rubyforge.org/pipermail/rspec-users/2011-January/019143.html

Comments and changes to this ticket

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>

Referenced by

Pages