Skip to content
Browse files

Fix permanent cookie jar accessor typo

  • Loading branch information...
1 parent c959798 commit c0b1eb112f2a604e39e52c3d840b58095f40f8f5 @trevorturk trevorturk committed
View
2 actionpack/lib/action_dispatch/middleware/cookies.rb
@@ -358,7 +358,7 @@ def initialize(parent_jar, key_generator, options = {})
end
def [](key)
- @parent_jar[name.to_s]
+ @parent_jar[key.to_s]
end
def []=(key, options)
View
7 actionpack/test/dispatch/cookies_test.rb
@@ -349,12 +349,17 @@ def test_cookies_persist_throughout_request
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]

0 comments on commit c0b1eb1

Please sign in to comment.
Something went wrong with that request. Please try again.