about summary refs log tree commit homepage
path: root/test/unit/test_cgi_wrapper.rb
diff options
context:
space:
mode:
authorevanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9>2008-05-24 23:06:53 +0000
committerevanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9>2008-05-24 23:06:53 +0000
commit45ff7b22b67123dd8345f3c50151e89cc91ce2b7 (patch)
treee85c8aa353e3e9f05e90ee8bf76a6593520e1b01 /test/unit/test_cgi_wrapper.rb
parentf69f3602b11dc839bb09f8c783b5ec27c54694fd (diff)
parentfa3f48f65222eb5591ef3dd9c05b6c958d564fa4 (diff)
downloadunicorn-45ff7b22b67123dd8345f3c50151e89cc91ce2b7.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@1020 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'test/unit/test_cgi_wrapper.rb')
-rw-r--r--test/unit/test_cgi_wrapper.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/test_cgi_wrapper.rb b/test/unit/test_cgi_wrapper.rb
new file mode 100644
index 0000000..a494655
--- /dev/null
+++ b/test/unit/test_cgi_wrapper.rb
@@ -0,0 +1,26 @@
+
+require 'test/test_helper'
+
+class MockHttpRequest
+  attr_reader :body
+
+  def params
+    return { 'REQUEST_METHOD' => 'GET'}
+  end
+end
+
+class CGIWrapperTest < Test::Unit::TestCase
+  
+  def test_set_cookies_output_cookies
+    request = MockHttpRequest.new
+    response = nil # not needed for this test
+    output_headers = {}
+    
+    cgi = Mongrel::CGIWrapper.new(request, response)
+    session = CGI::Session.new(cgi, 'database_manager' => CGI::Session::MemoryStore)
+    cgi.send_cookies(output_headers)
+    
+    assert(output_headers.has_key?("Set-Cookie"))
+    assert_equal("_session_id="+session.session_id+"; path=", output_headers["Set-Cookie"])
+  end
+end \ No newline at end of file