aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/activerecord
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-11-11 14:17:14 +0100
committerJosé Valim <jose.valim@gmail.com>2010-11-11 14:17:14 +0100
commit9c9f416d398c47dd2297fa5cc4025e0800d32212 (patch)
treefdc4f4774266cc6399ce35417839a246b4aed833 /actionpack/test/activerecord
parent2651a87a33981953e2f7966c69dc87e370a7ff11 (diff)
downloadrails-9c9f416d398c47dd2297fa5cc4025e0800d32212.tar.gz
rails-9c9f416d398c47dd2297fa5cc4025e0800d32212.tar.bz2
rails-9c9f416d398c47dd2297fa5cc4025e0800d32212.zip
Allow AR Session Store to be renewed
Diffstat (limited to 'actionpack/test/activerecord')
-rw-r--r--actionpack/test/activerecord/active_record_store_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/activerecord/active_record_store_test.rb b/actionpack/test/activerecord/active_record_store_test.rb
index f5811a1530..7c595d1b89 100644
--- a/actionpack/test/activerecord/active_record_store_test.rb
+++ b/actionpack/test/activerecord/active_record_store_test.rb
@@ -27,6 +27,12 @@ class ActiveRecordStoreTest < ActionDispatch::IntegrationTest
head :ok
end
+ def renew
+ env["rack.session.options"][:renew] = true
+ session[:foo] = "baz"
+ head :ok
+ end
+
def rescue_action(e) raise end
end
@@ -64,6 +70,20 @@ class ActiveRecordStoreTest < ActionDispatch::IntegrationTest
end
end
end
+
+ define_method("test_renewing_with_#{class_name}_store") do
+ with_store class_name do
+ with_test_route_set do
+ get '/set_session_value'
+ assert_response :success
+ assert cookies['_session_id']
+
+ get '/renew'
+ assert_response :success
+ assert_not_equal [], headers['Set-Cookie']
+ end
+ end
+ end
end
def test_getting_nil_session_value