diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-03-03 13:07:03 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-03-03 13:07:03 -0600 |
commit | 9b1b88f09cf1498f04e1cd469d0d5ffccf2b93cc (patch) | |
tree | f96b67e783b8f0537ffe9fe826578d87aa8bdaee /actionpack | |
parent | 4d4d2c3896ed5a5d74da833c5c3132f406f4eab7 (diff) | |
download | rails-9b1b88f09cf1498f04e1cd469d0d5ffccf2b93cc.tar.gz rails-9b1b88f09cf1498f04e1cd469d0d5ffccf2b93cc.tar.bz2 rails-9b1b88f09cf1498f04e1cd469d0d5ffccf2b93cc.zip |
Fixed reset_session for ActiveRecord session store [#2108 state:resolved]
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/activerecord/active_record_store_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/actionpack/test/activerecord/active_record_store_test.rb b/actionpack/test/activerecord/active_record_store_test.rb index 6a75e6050d..7998f9c22f 100644 --- a/actionpack/test/activerecord/active_record_store_test.rb +++ b/actionpack/test/activerecord/active_record_store_test.rb @@ -21,6 +21,11 @@ class ActiveRecordStoreTest < 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 @@ -61,6 +66,22 @@ class ActiveRecordStoreTest < ActionController::IntegrationTest 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 + def test_prevents_session_fixation with_test_route_set do get '/set_session_value' |