diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-04-30 19:23:50 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-04-30 19:23:50 -0500 |
commit | a6fff94baf0ca5d436cbc5c0fa81f690c8024ff5 (patch) | |
tree | 56dfb7ba1bed8c06fcc1a6237cd80ac72a27877f /actionpack/test | |
parent | d54604c352ca444c49e54f4dbbfcaff58f8c7d06 (diff) | |
download | rails-a6fff94baf0ca5d436cbc5c0fa81f690c8024ff5.tar.gz rails-a6fff94baf0ca5d436cbc5c0fa81f690c8024ff5.tar.bz2 rails-a6fff94baf0ca5d436cbc5c0fa81f690c8024ff5.zip |
Move TestRequest cookies accessor into AD TestRequest
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/test_request_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
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 |