From 89eec91e670ae267cd88b2b3555bfefe527f0eaa Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Wed, 16 Jul 2008 03:31:45 +0100 Subject: [PATCH] Add tests for CgiRequest#content_type --- actionpack/test/controller/cgi_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb index bf3b8b788e..7367036dec 100755 --- a/actionpack/test/controller/cgi_test.rb +++ b/actionpack/test/controller/cgi_test.rb @@ -168,6 +168,18 @@ def test_doesnt_interpret_request_uri_as_query_string_when_missing end end +class CgiRequestContentTypeTest < BaseCgiTest + def test_html_content_type_verification + @request.env['CONTENT_TYPE'] = Mime::HTML.to_s + assert @request.content_type.verify_request? + end + + def test_xml_content_type_verification + @request.env['CONTENT_TYPE'] = Mime::XML.to_s + assert !@request.content_type.verify_request? + end +end + class CgiRequestNeedsRewoundTest < BaseCgiTest def test_body_should_be_rewound data = 'foo'