diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-07-16 03:31:45 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-07-16 03:31:45 +0100 |
commit | 89eec91e670ae267cd88b2b3555bfefe527f0eaa (patch) | |
tree | a9daf7102429d55c08b037c14dd3069ffa53f7f5 | |
parent | 0f8206104e5dfca1024d1f6bc12a8783c00527e2 (diff) | |
download | rails-89eec91e670ae267cd88b2b3555bfefe527f0eaa.tar.gz rails-89eec91e670ae267cd88b2b3555bfefe527f0eaa.tar.bz2 rails-89eec91e670ae267cd88b2b3555bfefe527f0eaa.zip |
Add tests for CgiRequest#content_type
-rwxr-xr-x | actionpack/test/controller/cgi_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
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 @@ class CgiRequestParamsParsingTest < BaseCgiTest 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' |