1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/test/test_cgi_wrapper.rb
evanweaver fab6173a05 use synchronous stop everywhere; clean up test helpers
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@705 19e92222-5c0b-0410-8929-a290d50e31e9
2007-10-20 23:15:19 +00:00

26 lines
No EOL
659 B
Ruby

require 'test/testhelp'
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