aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/cookie_test.rb
diff options
context:
space:
mode:
authorMathias Biilmann Christensen <mbc@mbcbook-2.local>2010-03-18 01:15:52 +0100
committerJeremy Kemper <jeremy@bitsweat.net>2010-03-17 18:04:32 -0700
commitc8dd6f224c9345b7e95cc0203b636e49412b71dc (patch)
treef5a37c4270dc0a223f17d3c1c3ae13db56220eff /actionpack/test/controller/cookie_test.rb
parent0e15f07b75d04ddc349a93ad7fdfcbc502ef535d (diff)
downloadrails-c8dd6f224c9345b7e95cc0203b636e49412b71dc.tar.gz
rails-c8dd6f224c9345b7e95cc0203b636e49412b71dc.tar.bz2
rails-c8dd6f224c9345b7e95cc0203b636e49412b71dc.zip
Deleting and setting a cookie in the same request was broken
Made sure to remove a cookie from @deleted_cookies when set [#4211 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack/test/controller/cookie_test.rb')
-rw-r--r--actionpack/test/controller/cookie_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/controller/cookie_test.rb b/actionpack/test/controller/cookie_test.rb
index 908967a110..36498d13a9 100644
--- a/actionpack/test/controller/cookie_test.rb
+++ b/actionpack/test/controller/cookie_test.rb
@@ -64,6 +64,12 @@ class CookieTest < ActionController::TestCase
cookies.permanent.signed[:remember_me] = 100
head :ok
end
+
+ def delete_and_set_cookie
+ cookies.delete :user_name
+ cookies[:user_name] = { :value => "david", :expires => Time.utc(2005, 10, 10,5) }
+ head :ok
+ end
end
tests TestController
@@ -152,6 +158,11 @@ class CookieTest < ActionController::TestCase
assert_equal 100, @controller.send(:cookies).signed[:remember_me]
end
+ def test_delete_and_set_cookie
+ get :delete_and_set_cookie
+ assert_cookie_header "user_name=david; path=/; expires=Mon, 10-Oct-2005 05:00:00 GMT"
+ assert_equal({"user_name" => "david"}, @response.cookies)
+ end
private
def assert_cookie_header(expected)