aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/cookie_test.rb
diff options
context:
space:
mode:
authorOlly Legg <olly@51degrees.net>2009-05-28 09:18:27 -0500
committerJoshua Peek <josh@joshpeek.com>2009-05-28 09:18:27 -0500
commit0349278f3da9f7f532330cf295eed35ede3bae66 (patch)
tree5ae44b3e35c12ec2621c49e78b846b0a38ab0012 /actionpack/test/controller/cookie_test.rb
parentd17fb9dc766936efc721fc3e55ef9289902dc34c (diff)
downloadrails-0349278f3da9f7f532330cf295eed35ede3bae66.tar.gz
rails-0349278f3da9f7f532330cf295eed35ede3bae66.tar.bz2
rails-0349278f3da9f7f532330cf295eed35ede3bae66.zip
Memoize cookies so that updates to cookies are available in the current request. [#2733 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/test/controller/cookie_test.rb')
-rw-r--r--actionpack/test/controller/cookie_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/controller/cookie_test.rb b/actionpack/test/controller/cookie_test.rb
index 39d0017dd8..7199da3441 100644
--- a/actionpack/test/controller/cookie_test.rb
+++ b/actionpack/test/controller/cookie_test.rb
@@ -123,6 +123,12 @@ class CookieTest < ActionController::TestCase
assert_cookie_header "user_name=; path=/beaten; expires=Thu, 01-Jan-1970 00:00:00 GMT"
end
+ def test_cookies_persist_throughout_request
+ get :authenticate
+ cookies = @controller.send(:cookies)
+ assert_equal 'david', cookies['user_name']
+ end
+
private
def assert_cookie_header(expected)
header = @response.headers["Set-Cookie"]