aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/cookies_test.rb
diff options
context:
space:
mode:
authorbrainopia <brainopia@evilmartians.com>2012-04-30 16:55:06 +0400
committerbrainopia <brainopia@evilmartians.com>2012-04-30 17:04:17 +0400
commit2d18dd34719b1f9a3d2e3a516ccb83e7067dcd91 (patch)
tree9a9a8f0367244c034fd061028551704825a8911e /actionpack/test/dispatch/cookies_test.rb
parentff2667d21a2c183d031acce44d95d06a8c99c035 (diff)
downloadrails-2d18dd34719b1f9a3d2e3a516ccb83e7067dcd91.tar.gz
rails-2d18dd34719b1f9a3d2e3a516ccb83e7067dcd91.tar.bz2
rails-2d18dd34719b1f9a3d2e3a516ccb83e7067dcd91.zip
Dont stream back cookie value if it was set to the same value
Diffstat (limited to 'actionpack/test/dispatch/cookies_test.rb')
-rw-r--r--actionpack/test/dispatch/cookies_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/cookies_test.rb b/actionpack/test/dispatch/cookies_test.rb
index 3c1cc5fb21..2467654a70 100644
--- a/actionpack/test/dispatch/cookies_test.rb
+++ b/actionpack/test/dispatch/cookies_test.rb
@@ -181,6 +181,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=/"