Permalink
Browse files

adding test

  • Loading branch information...
1 parent 7c000af commit 2d50887b2437aaee2b051b06367bedfb9949eedf @stevenbristol stevenbristol committed May 19, 2011
Showing with 8 additions and 4 deletions.
  1. +8 −4 actionpack/test/dispatch/cookies_test.rb
@@ -121,7 +121,7 @@ def symbol_key
end
def string_key
- cookies['user_name'] = "david"
+ cookies['user_name'] = "dhh"
head :ok
end
@@ -417,14 +417,18 @@ def test_deletings_cookie_with_several_preset_domains_using_other_domain
assert_cookie_header "user_name=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT"
end
+
def test_cookies_hash_is_indifferent_access
- [:symbol_key, :string_key].each do |cookie_key|
- get cookie_key
+ get :symbol_key
assert_equal "david", cookies[:user_name]
assert_equal "david", cookies['user_name']
- end
+ get :string_key
+ assert_equal "dhh", cookies[:user_name]
+ assert_equal "dhh", cookies['user_name']
end
+
+
def test_setting_request_cookies_is_indifferent_access
@request.cookies.clear
@request.cookies[:user_name] = "andrew"

0 comments on commit 2d50887

Please sign in to comment.