mirror of
https://github.com/github/rails.git
synced 2026-01-26 14:58:11 -05:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user