aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/response_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-09-23 11:25:33 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-09-23 11:25:33 -0700
commit39df51e17176b43bf5da8bc53db719d0187423ab (patch)
treed9ab2cbdffb1cdde378fa945a9956015bc157305 /actionpack/test/dispatch/response_test.rb
parent4cf449df9136117f2f0acf9730bf754f889f4dfa (diff)
downloadrails-39df51e17176b43bf5da8bc53db719d0187423ab.tar.gz
rails-39df51e17176b43bf5da8bc53db719d0187423ab.tar.bz2
rails-39df51e17176b43bf5da8bc53db719d0187423ab.zip
split cookie tests
these should really be multiple tests.
Diffstat (limited to 'actionpack/test/dispatch/response_test.rb')
-rw-r--r--actionpack/test/dispatch/response_test.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/response_test.rb b/actionpack/test/dispatch/response_test.rb
index 024fd391d5..795d036e20 100644
--- a/actionpack/test/dispatch/response_test.rb
+++ b/actionpack/test/dispatch/response_test.rb
@@ -149,14 +149,19 @@ class ResponseTest < ActiveSupport::TestCase
status, headers, body = @response.to_a
assert_equal "user_name=david; path=/", headers["Set-Cookie"]
assert_equal({"user_name" => "david"}, @response.cookies)
+ end
- @response = ActionDispatch::TestResponse.new
+ test "multiple cookies" do
@response.set_cookie("user_name", :value => "david", :path => "/")
@response.set_cookie("login", :value => "foo&bar", :path => "/", :expires => Time.utc(2005, 10, 10,5))
status, headers, body = @response.to_a
assert_equal "user_name=david; path=/\nlogin=foo%26bar; path=/; expires=Mon, 10 Oct 2005 05:00:00 -0000", headers["Set-Cookie"]
assert_equal({"login" => "foo&bar", "user_name" => "david"}, @response.cookies)
+ end
+ test "delete cookies" do
+ @response.set_cookie("user_name", :value => "david", :path => "/")
+ @response.set_cookie("login", :value => "foo&bar", :path => "/", :expires => Time.utc(2005, 10, 10,5))
@response.delete_cookie("login")
status, headers, body = @response.to_a
assert_equal({"user_name" => "david", "login" => nil}, @response.cookies)