mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix permanent cookie jar accessor typo
This commit is contained in:
parent
c959798571
commit
c0b1eb112f
2 changed files with 7 additions and 2 deletions
|
@ -358,7 +358,7 @@ module ActionDispatch
|
|||
end
|
||||
|
||||
def [](key)
|
||||
@parent_jar[name.to_s]
|
||||
@parent_jar[key.to_s]
|
||||
end
|
||||
|
||||
def []=(key, options)
|
||||
|
|
|
@ -349,12 +349,17 @@ class CookiesTest < ActionController::TestCase
|
|||
assert response.headers["Set-Cookie"] =~ /user_name=david/
|
||||
end
|
||||
|
||||
def test_permanent_cookie
|
||||
def test_set_permanent_cookie
|
||||
get :set_permanent_cookie
|
||||
assert_match(/Jamie/, @response.headers["Set-Cookie"])
|
||||
assert_match(%r(#{20.years.from_now.utc.year}), @response.headers["Set-Cookie"])
|
||||
end
|
||||
|
||||
def test_read_permanent_cookie
|
||||
get :set_permanent_cookie
|
||||
assert_equal 'Jamie', @controller.send(:cookies).permanent[:user_name]
|
||||
end
|
||||
|
||||
def test_signed_cookie
|
||||
get :set_signed_cookie
|
||||
assert_equal 45, @controller.send(:cookies).signed[:user_id]
|
||||
|
|
Loading…
Reference in a new issue