diff options
author | José Valim <jose.valim@gmail.com> | 2010-07-18 12:51:03 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-07-18 12:51:03 +0200 |
commit | 291adcd588e86746145e4ba9ab2ea4d0de26279f (patch) | |
tree | e5db71937e15fe14cae31aed990113b9ae0f79ba /actionpack/test/dispatch/session | |
parent | cdfa11409c6196d35e890cf1766e1e2cc6f3d7d7 (diff) | |
download | rails-291adcd588e86746145e4ba9ab2ea4d0de26279f.tar.gz rails-291adcd588e86746145e4ba9ab2ea4d0de26279f.tar.bz2 rails-291adcd588e86746145e4ba9ab2ea4d0de26279f.zip |
Set session options id to nil is respected and cancels lazy loading.
Diffstat (limited to 'actionpack/test/dispatch/session')
-rw-r--r-- | actionpack/test/dispatch/session/cookie_store_test.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/session/cookie_store_test.rb b/actionpack/test/dispatch/session/cookie_store_test.rb index f0e01bfff0..3864821ef0 100644 --- a/actionpack/test/dispatch/session/cookie_store_test.rb +++ b/actionpack/test/dispatch/session/cookie_store_test.rb @@ -44,7 +44,12 @@ class CookieStoreTest < ActionController::IntegrationTest session[:foo] = 'bye!' * 1024 head :ok end - + + def change_session_id + request.session_options[:id] = nil + get_session_id + end + def rescue_action(e) raise end end @@ -212,6 +217,19 @@ class CookieStoreTest < ActionController::IntegrationTest end end + def test_setting_session_id_to_nil_is_respected + with_test_route_set do + cookies[SessionKey] = SignedBar + + get "/get_session_id" + sid = response.body + assert_equal sid.size, 36 + + get "/change_session_id" + assert_not_equal sid, response.body + end + end + def test_session_store_with_expire_after with_test_route_set(:expire_after => 5.hours) do # First request accesses the session |