aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-05-04 20:12:27 +0200
committerJosé Valim <jose.valim@gmail.com>2011-05-04 20:12:27 +0200
commitafc3ccf74cbb6c3d495558e934ced1c006dacda8 (patch)
treeefba9364ac490d6466a0094da6ab2ce2a131a102 /actionpack/test/dispatch
parent6b79463ed8d04c7807c0695fcb3d4c11e4be9fa2 (diff)
downloadrails-afc3ccf74cbb6c3d495558e934ced1c006dacda8.tar.gz
rails-afc3ccf74cbb6c3d495558e934ced1c006dacda8.tar.bz2
rails-afc3ccf74cbb6c3d495558e934ced1c006dacda8.zip
Fix renew feature on cookies.
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/session/cookie_store_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/session/cookie_store_test.rb b/actionpack/test/dispatch/session/cookie_store_test.rb
index 27f55fd7ab..b0efbcef4a 100644
--- a/actionpack/test/dispatch/session/cookie_store_test.rb
+++ b/actionpack/test/dispatch/session/cookie_store_test.rb
@@ -50,6 +50,11 @@ class CookieStoreTest < ActionDispatch::IntegrationTest
get_session_id
end
+ def renew_session_id
+ request.session_options[:renew] = true
+ head :ok
+ end
+
def rescue_action(e) raise end
end
@@ -102,6 +107,17 @@ class CookieStoreTest < ActionDispatch::IntegrationTest
end
end
+ def test_properly_renew_cookies
+ with_test_route_set do
+ get '/set_session_value'
+ get '/persistent_session_id'
+ session_id = response.body
+ get '/renew_session_id'
+ get '/persistent_session_id'
+ assert_not_equal response.body, session_id
+ end
+ end
+
def test_does_set_secure_cookies_over_https
with_test_route_set(:secure => true) do
get '/set_session_value', nil, 'HTTPS' => 'on'