Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #10059 from trevorturk/perm-cookie-jar-fix

Fix permanent cookie jar accessor typo
  • Loading branch information...
commit 761d25b0eb460cc986a1b7b70fa1dab0f30765b8 2 parents c959798 + c0b1eb1
Steve Klabnik steveklabnik authored
2  actionpack/lib/action_dispatch/middleware/cookies.rb
View
@@ -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)
7 actionpack/test/dispatch/cookies_test.rb
View
@@ -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]
Please sign in to comment.
Something went wrong with that request. Please try again.