aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/cookie_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-11-26 02:09:38 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-11-26 02:09:38 +0000
commitdefda16b834ffc4a78def1c4b6c2299b754fe901 (patch)
treeceb7721e9d2a0129d2dc94a5e74fed02e381678f /actionpack/test/controller/cookie_test.rb
parentd0c90331f19004f9f297989785f1516631ea0fc3 (diff)
downloadrails-defda16b834ffc4a78def1c4b6c2299b754fe901.tar.gz
rails-defda16b834ffc4a78def1c4b6c2299b754fe901.tar.bz2
rails-defda16b834ffc4a78def1c4b6c2299b754fe901.zip
Allow symbols to be used as keys for setting cookies
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@21 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/cookie_test.rb')
-rw-r--r--actionpack/test/controller/cookie_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/cookie_test.rb b/actionpack/test/controller/cookie_test.rb
index 1bd17c5c2f..41dc3393f1 100644
--- a/actionpack/test/controller/cookie_test.rb
+++ b/actionpack/test/controller/cookie_test.rb
@@ -17,6 +17,11 @@ class CookieTest < Test::Unit::TestCase
render_text "hello world"
end
+ def authenticate_for_fourten_days_with_symbols
+ cookies["user_name"] = { :value => "david", :expires => Time.local(2005, 10, 10) }
+ render_text "hello world"
+ end
+
def set_multiple_cookies
cookies["user_name"] = { "value" => "david", "expires" => Time.local(2005, 10, 10) }
cookies["login"] = "XJ-122"
@@ -52,6 +57,11 @@ class CookieTest < Test::Unit::TestCase
assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david", "expires" => Time.local(2005, 10, 10)) ], process_request.headers["cookie"]
end
+ def test_setting_cookie_for_fourteen_days_with_symbols
+ @request.action = "authenticate_for_fourten_days"
+ assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david", "expires" => Time.local(2005, 10, 10)) ], process_request.headers["cookie"]
+ end
+
def test_multiple_cookies
@request.action = "set_multiple_cookies"
assert_equal 2, process_request.headers["cookie"].size