Class: ActionController::TestSession
- Inherits:
-
Rack::Session::Abstract::SessionHash
- Object
- Rack::Session::Abstract::SessionHash
- ActionController::TestSession
- Defined in:
- lib/action_controller/test_case.rb
Overview
Methods #destroy and #load! are overridden to avoid calling methods on the
Constant Summary collapse
- DEFAULT_OPTIONS =
:nodoc:
Rack::Session::Abstract::ID::DEFAULT_OPTIONS
Instance Method Summary collapse
- #destroy ⇒ Object
- #exists? ⇒ Boolean
-
#initialize(session = {}) ⇒ TestSession
constructor
A new instance of TestSession.
- #keys ⇒ Object
- #values ⇒ Object
Constructor Details
#initialize(session = {}) ⇒ TestSession
Returns a new instance of TestSession.
266 267 268 269 270 271 |
# File 'lib/action_controller/test_case.rb', line 266 def initialize(session = {}) super(nil, nil) @id = SecureRandom.hex(16) @data = stringify_keys(session) @loaded = true end |
Instance Method Details
#destroy ⇒ Object
285 286 287 |
# File 'lib/action_controller/test_case.rb', line 285 def destroy clear end |
#exists? ⇒ Boolean
273 274 275 |
# File 'lib/action_controller/test_case.rb', line 273 def exists? true end |
#keys ⇒ Object
277 278 279 |
# File 'lib/action_controller/test_case.rb', line 277 def keys @data.keys end |
#values ⇒ Object
281 282 283 |
# File 'lib/action_controller/test_case.rb', line 281 def values @data.values end |