diff options
author | brainopia <brainopia@evilmartians.com> | 2012-04-30 16:55:06 +0400 |
---|---|---|
committer | brainopia <brainopia@evilmartians.com> | 2012-08-10 10:00:04 +0400 |
commit | bbe634e72cfbe9d66f08e0e22b0c718f136ae934 (patch) | |
tree | a6ef2dd7dc99f1215b9f254f0318a89123f6f5e9 /actionpack/test | |
parent | 058dc9a09680e9e2a5777c441b966a6f5e12cf82 (diff) | |
download | rails-bbe634e72cfbe9d66f08e0e22b0c718f136ae934.tar.gz rails-bbe634e72cfbe9d66f08e0e22b0c718f136ae934.tar.bz2 rails-bbe634e72cfbe9d66f08e0e22b0c718f136ae934.zip |
Dont stream back cookie value if it was set to the same value
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/cookies_test.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/cookies_test.rb b/actionpack/test/dispatch/cookies_test.rb index 6ebd02e85c..6b93e2fa75 100644 --- a/actionpack/test/dispatch/cookies_test.rb +++ b/actionpack/test/dispatch/cookies_test.rb @@ -179,6 +179,18 @@ class CookiesTest < ActionController::TestCase assert_equal({"user_name" => "david"}, @response.cookies) end + def test_setting_the_same_value_to_cookie + request.cookies[:user_name] = 'david' + get :authenticate + assert response.cookies.empty? + end + + def test_setting_the_same_value_to_permanent_cookie + request.cookies[:user_name] = 'Jamie' + get :set_permanent_cookie + assert response.cookies, 'user_name' => 'Jamie' + end + def test_setting_with_escapable_characters get :set_with_with_escapable_characters assert_cookie_header "that+%26+guy=foo+%26+bar+%3D%3E+baz; path=/" @@ -564,4 +576,4 @@ class CookiesTest < ActionController::TestCase assert_not_equal expected.split("\n"), header end end -end
\ No newline at end of file +end |