Class: Authentication::Logic::TestCase::MockCookieJar
- Inherits:
-
Hash
- Object
- Hash
- Authentication::Logic::TestCase::MockCookieJar
show all
- Defined in:
- lib/auth/logic/test_case/mock_cookie_jar.rb
Overview
A mock of ‘ActionDispatch::Cookies::CookieJar`. See action_dispatch/middleware/cookies.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#set_cookies ⇒ Object
9
10
11
|
# File 'lib/auth/logic/test_case/mock_cookie_jar.rb', line 9
def set_cookies
@set_cookies
end
|
Instance Method Details
#[](key) ⇒ Object
11
12
13
14
|
# File 'lib/auth/logic/test_case/mock_cookie_jar.rb', line 11
def [](key)
hash = super
hash && hash[:value]
end
|
#[]=(key, options) ⇒ Object
options as documented above [in action_dispatch/middleware/cookies.rb]“
18
19
20
21
22
|
# File 'lib/auth/logic/test_case/mock_cookie_jar.rb', line 18
def []=(key, options)
opt = cookie_options_to_hash(options)
(@set_cookies ||= {})[key.to_s] = opt
super(key, opt)
end
|
#delete(key, _options = {}) ⇒ Object
24
25
26
|
# File 'lib/auth/logic/test_case/mock_cookie_jar.rb', line 24
def delete(key, _options = {})
super(key)
end
|
#encrypted ⇒ Object
32
33
34
|
# File 'lib/auth/logic/test_case/mock_cookie_jar.rb', line 32
def encrypted
@encrypted ||= MockEncryptedCookieJar.new(self)
end
|
#signed ⇒ Object
28
29
30
|
# File 'lib/auth/logic/test_case/mock_cookie_jar.rb', line 28
def signed
@signed ||= MockSignedCookieJar.new(self)
end
|