diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-10-26 18:01:09 -0700 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-10-26 18:01:09 -0700 |
commit | 000d5936216f363a5b11013f664959019b7ebac2 (patch) | |
tree | 456fcd6383cf224fc890f1737d744e9ec74f5cac /actionpack/test/controller/cookie_test.rb | |
parent | e1786ee6ebee9fab10d6756be1eeacbbe6b65b48 (diff) | |
download | rails-000d5936216f363a5b11013f664959019b7ebac2.tar.gz rails-000d5936216f363a5b11013f664959019b7ebac2.tar.bz2 rails-000d5936216f363a5b11013f664959019b7ebac2.zip |
Clean up and update cookies
Diffstat (limited to 'actionpack/test/controller/cookie_test.rb')
-rw-r--r-- | actionpack/test/controller/cookie_test.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/actionpack/test/controller/cookie_test.rb b/actionpack/test/controller/cookie_test.rb index b429cbf0e6..53d4364576 100644 --- a/actionpack/test/controller/cookie_test.rb +++ b/actionpack/test/controller/cookie_test.rb @@ -106,7 +106,7 @@ class CookieTest < ActionController::TestCase def test_cookiejar_accessor @request.cookies["user_name"] = "david" @controller.request = @request - jar = ActionController::CookieJar.new(@controller) + jar = ActionController::CookieJar.build(@controller.request, @controller.response) assert_equal "david", jar["user_name"] assert_equal nil, jar["something_else"] end @@ -114,14 +114,14 @@ class CookieTest < ActionController::TestCase def test_cookiejar_accessor_with_array_value @request.cookies["pages"] = %w{1 2 3} @controller.request = @request - jar = ActionController::CookieJar.new(@controller) + jar = ActionController::CookieJar.build(@controller.request, @controller.response) assert_equal %w{1 2 3}, jar["pages"] end def test_cookiejar_delete_removes_item_and_returns_its_value @request.cookies["user_name"] = "david" @controller.response = @response - jar = ActionController::CookieJar.new(@controller) + jar = ActionController::CookieJar.build(@controller.request, @controller.response) assert_equal "david", jar.delete("user_name") end @@ -131,9 +131,8 @@ class CookieTest < ActionController::TestCase end def test_cookies_persist_throughout_request - get :authenticate - cookies = @controller.send(:cookies) - assert_equal 'david', cookies['user_name'] + response = get :authenticate + assert response.headers["Set-Cookie"] =~ /user_name=david/ end private |