From 2dedb5b03ab88a1c31068f71c8d4cad7c5a5d9ae Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 29 Jan 2009 19:39:48 -0600 Subject: Controller, response, and request should all refer to same session, even after a call to session_reset [#1823 state:resolved] Signed-off-by: Joshua Peek --- actionpack/test/controller/test_test.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index ee7b8ade8c..65c894c2e7 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -23,6 +23,11 @@ class TestTest < ActionController::TestCase render :text => 'Success' end + def reset_the_session + reset_session + render :text => 'ignore me' + end + def render_raw_post raise ActiveSupport::TestCase::Assertion, "#raw_post is blank" if request.raw_post.blank? render :text => request.raw_post @@ -171,6 +176,24 @@ XML assert_equal 'value2', session[:symbol] end + def test_session_is_cleared_from_controller_after_reset_session + process :set_session + process :reset_the_session + assert_equal Hash.new, @controller.session.to_hash + end + + def test_session_is_cleared_from_response_after_reset_session + process :set_session + process :reset_the_session + assert_equal Hash.new, @response.session.to_hash + end + + def test_session_is_cleared_from_request_after_reset_session + process :set_session + process :reset_the_session + assert_equal Hash.new, @request.session.to_hash + end + def test_process_with_request_uri_with_no_params process :test_uri assert_equal "/test_test/test/test_uri", @response.body -- cgit v1.2.3