From a6fff94baf0ca5d436cbc5c0fa81f690c8024ff5 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Thu, 30 Apr 2009 19:23:50 -0500 Subject: Move TestRequest cookies accessor into AD TestRequest --- actionpack/test/dispatch/test_request_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'actionpack/test/dispatch/test_request_test.rb') diff --git a/actionpack/test/dispatch/test_request_test.rb b/actionpack/test/dispatch/test_request_test.rb index f13f67f0ae..19b5e2988b 100644 --- a/actionpack/test/dispatch/test_request_test.rb +++ b/actionpack/test/dispatch/test_request_test.rb @@ -27,4 +27,19 @@ class TestRequestTest < ActiveSupport::TestCase assert env.empty?, env.inspect end + + test "cookie jar" do + req = ActionDispatch::TestRequest.new + + assert_equal({}, req.cookies) + assert_equal nil, req.env["HTTP_COOKIE"] + + req.cookies["user_name"] = "david" + assert_equal({"user_name" => "david"}, req.cookies) + assert_equal "user_name=david;", req.env["HTTP_COOKIE"] + + req.cookies["login"] = "XJ-122" + assert_equal({"user_name" => "david", "login" => "XJ-122"}, req.cookies) + assert_equal "login=XJ-122; user_name=david;", req.env["HTTP_COOKIE"] + end end -- cgit v1.2.3