diff options
author | steve <steve@lesseverything.com> | 2011-05-19 10:33:18 -0400 |
---|---|---|
committer | steve <steve@lesseverything.com> | 2011-05-19 10:33:18 -0400 |
commit | 2d50887b2437aaee2b051b06367bedfb9949eedf (patch) | |
tree | 2f4a92ec8495def0d2082df96beff8a97ef38d0e | |
parent | 7c000af86726db5f7a2f91e01acacafb49a02f44 (diff) | |
download | rails-2d50887b2437aaee2b051b06367bedfb9949eedf.tar.gz rails-2d50887b2437aaee2b051b06367bedfb9949eedf.tar.bz2 rails-2d50887b2437aaee2b051b06367bedfb9949eedf.zip |
adding test
-rw-r--r-- | actionpack/test/dispatch/cookies_test.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/actionpack/test/dispatch/cookies_test.rb b/actionpack/test/dispatch/cookies_test.rb index ebc16694db..e42c39f527 100644 --- a/actionpack/test/dispatch/cookies_test.rb +++ b/actionpack/test/dispatch/cookies_test.rb @@ -121,7 +121,7 @@ class CookiesTest < ActionController::TestCase end def string_key - cookies['user_name'] = "david" + cookies['user_name'] = "dhh" head :ok end @@ -417,14 +417,18 @@ class CookiesTest < ActionController::TestCase 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" |