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:
parent
06843f8794
commit
d76439239d
@ -26,6 +26,18 @@ def tell
|
||||
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 @@ def test_session_off_conditionally
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user