diff options
author | Matt Bauer <bauer@Mosquito.local> | 2008-12-20 14:37:51 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-12-20 14:37:51 -0600 |
commit | 7b249b67e9df9f375eaad9e6eb41be73338faaa7 (patch) | |
tree | a40d4f8d4e395564cb00afcb4e946114045da117 /actionpack/test/controller/session/mem_cache_store_test.rb | |
parent | 462c75b60c659d75fafaeb10dd6ba9d4c16b6cb2 (diff) | |
download | rails-7b249b67e9df9f375eaad9e6eb41be73338faaa7.tar.gz rails-7b249b67e9df9f375eaad9e6eb41be73338faaa7.tar.bz2 rails-7b249b67e9df9f375eaad9e6eb41be73338faaa7.zip |
Fix reset_session with lazy cookie stores [#1601 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/test/controller/session/mem_cache_store_test.rb')
-rw-r--r-- | actionpack/test/controller/session/mem_cache_store_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/actionpack/test/controller/session/mem_cache_store_test.rb b/actionpack/test/controller/session/mem_cache_store_test.rb index 52e31b78da..eb896a344c 100644 --- a/actionpack/test/controller/session/mem_cache_store_test.rb +++ b/actionpack/test/controller/session/mem_cache_store_test.rb @@ -16,6 +16,11 @@ class MemCacheStoreTest < ActionController::IntegrationTest render :text => "foo: #{session[:foo].inspect}" end + def call_reset_session + reset_session + head :ok + end + def rescue_action(e) raise end end @@ -63,6 +68,22 @@ class MemCacheStoreTest < ActionController::IntegrationTest assert_equal nil, cookies['_session_id'] end end + + def test_setting_session_value_after_session_reset + with_test_route_set do + get '/set_session_value' + assert_response :success + assert cookies['_session_id'] + + get '/call_reset_session' + assert_response :success + assert_not_equal [], headers['Set-Cookie'] + + get '/get_session_value' + assert_response :success + assert_equal 'foo: nil', response.body + end + end rescue LoadError, RuntimeError $stderr.puts "Skipping MemCacheStoreTest tests. Start memcached and try again." end |