From d76439239dc7b8870afef34afccfedcd1ffd7ad0 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Fri, 22 Jul 2005 10:56:53 +0000 Subject: Add unit test to ensure that session management options are inherited and overridable in subclasses git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1888 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../test/controller/session_management_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'actionpack/test/controller/session_management_test.rb') diff --git a/actionpack/test/controller/session_management_test.rb b/actionpack/test/controller/session_management_test.rb index fef94f8263..707c4287f1 100644 --- a/actionpack/test/controller/session_management_test.rb +++ b/actionpack/test/controller/session_management_test.rb @@ -26,6 +26,18 @@ class SessionManagementTest < Test::Unit::TestCase end end + class SpecializedController < SessionOffController + session :disabled => false, :only => :something + + def something + render_text "done" + end + + def another + render_text "done" + end + end + def setup @request, @response = ActionController::TestRequest.new, ActionController::TestResponse.new @@ -47,4 +59,12 @@ class SessionManagementTest < Test::Unit::TestCase assert_instance_of Hash, @request.session_options assert @request.session_options[:session_secure] end + + def test_controller_specialization_overrides_settings + @controller = SpecializedController.new + get :something + assert_instance_of Hash, @request.session_options + get :another + assert_equal false, @request.session_options + end end -- cgit v1.2.3