1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Clarify cookie jar test

This commit is contained in:
Jeremy Kemper 2010-03-04 15:31:22 -08:00
parent 7c785592ec
commit 5e3e5ac12b

View file

@ -284,18 +284,13 @@ class IntegrationProcessTest < ActionController::IntegrationTest
end end
end end
def test_cookie_monster test 'response cookies are added to the cookie jar for the next request' do
with_test_route_set do with_test_route_set do
self.cookies['cookie_1'] = "sugar" self.cookies['cookie_1'] = "sugar"
self.cookies['cookie_2'] = "oatmeal" self.cookies['cookie_2'] = "oatmeal"
get '/cookie_monster' get '/cookie_monster'
assert_equal 410, status
assert_equal "Gone", status_message
assert_response 410
assert_response :gone
assert_equal "cookie_1=; path=/\ncookie_3=chocolate; path=/", headers["Set-Cookie"] assert_equal "cookie_1=; path=/\ncookie_3=chocolate; path=/", headers["Set-Cookie"]
assert_equal({"cookie_1"=>"", "cookie_2"=>"oatmeal", "cookie_3"=>"chocolate"}, cookies.to_hash) assert_equal({"cookie_1"=>"", "cookie_2"=>"oatmeal", "cookie_3"=>"chocolate"}, cookies.to_hash)
assert_equal "Gone", response.body
end end
end end