diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-12-19 16:49:06 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-12-19 16:49:06 -0600 |
commit | a14bbd7a8574c3b485d4b71e0950b2b9ff4e90d7 (patch) | |
tree | 21d5f53af84aafef5a7eff9e6c94d07b752ccc4d /actionpack/test/controller | |
parent | cbee72d21630f8949c4575cd1fd5a6f2e13d7827 (diff) | |
download | rails-a14bbd7a8574c3b485d4b71e0950b2b9ff4e90d7.tar.gz rails-a14bbd7a8574c3b485d4b71e0950b2b9ff4e90d7.tar.bz2 rails-a14bbd7a8574c3b485d4b71e0950b2b9ff4e90d7.zip |
Process CGI 'cookie' header into 'Set-Cookie' for all responses.
This mostly affects response.headers['cookie'] for test requests. Use response.cookies instead.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/cookie_test.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/actionpack/test/controller/cookie_test.rb b/actionpack/test/controller/cookie_test.rb index 67f31ba36b..cfe5726253 100644 --- a/actionpack/test/controller/cookie_test.rb +++ b/actionpack/test/controller/cookie_test.rb @@ -51,33 +51,33 @@ class CookieTest < Test::Unit::TestCase def test_setting_cookie get :authenticate - assert_equal "user_name=david; path=/", @response.headers["cookie"].to_s + assert_equal ["user_name=david; path=/"], @response.headers["Set-Cookie"] assert_equal({"user_name" => ["david"]}, @response.cookies) end def test_setting_cookie_for_fourteen_days get :authenticate_for_fourteen_days - assert_equal "user_name=david; path=/; expires=Mon, 10 Oct 2005 05:00:00 GMT", @response.headers["cookie"].to_s + assert_equal ["user_name=david; path=/; expires=Mon, 10 Oct 2005 05:00:00 GMT"], @response.headers["Set-Cookie"] assert_equal({"user_name" => ["david"]}, @response.cookies) end def test_setting_cookie_for_fourteen_days_with_symbols get :authenticate_for_fourteen_days_with_symbols - assert_equal "user_name=david; path=/; expires=Mon, 10 Oct 2005 05:00:00 GMT", @response.headers["cookie"].to_s + assert_equal ["user_name=david; path=/; expires=Mon, 10 Oct 2005 05:00:00 GMT"], @response.headers["Set-Cookie"] assert_equal({"user_name" => ["david"]}, @response.cookies) end def test_setting_cookie_with_http_only get :authenticate_with_http_only - assert_equal "user_name=david; path=/; HttpOnly", @response.headers["cookie"].to_s + assert_equal ["user_name=david; path=/; HttpOnly"], @response.headers["Set-Cookie"] assert_equal({"user_name" => ["david"]}, @response.cookies) end def test_multiple_cookies get :set_multiple_cookies assert_equal 2, @response.cookies.size - assert_equal "user_name=david; path=/; expires=Mon, 10 Oct 2005 05:00:00 GMT", @response.headers["cookie"][0].to_s - assert_equal "login=XJ-122; path=/", @response.headers["cookie"][1].to_s + assert_equal "user_name=david; path=/; expires=Mon, 10 Oct 2005 05:00:00 GMT", @response.headers["Set-Cookie"][0] + assert_equal "login=XJ-122; path=/", @response.headers["Set-Cookie"][1] assert_equal({"login" => ["XJ-122"], "user_name" => ["david"]}, @response.cookies) end @@ -87,7 +87,7 @@ class CookieTest < Test::Unit::TestCase def test_expiring_cookie get :logout - assert_equal "user_name=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT", @response.headers["cookie"].to_s + assert_equal ["user_name=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT"], @response.headers["Set-Cookie"] assert_equal({"user_name" => []}, @response.cookies) end @@ -109,7 +109,7 @@ class CookieTest < Test::Unit::TestCase def test_delete_cookie_with_path get :delete_cookie_with_path - assert_equal "user_name=; path=/beaten; expires=Thu, 01 Jan 1970 00:00:00 GMT", @response.headers["cookie"].to_s + assert_equal ["user_name=; path=/beaten; expires=Thu, 01 Jan 1970 00:00:00 GMT"], @response.headers["Set-Cookie"] end def test_cookie_to_s_simple_values |