diff options
Diffstat (limited to 'actionpack/test')
-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 |