Add tests for CgiRequest#content_type
This commit is contained in:
parent
0f8206104e
commit
89eec91e67
@ -168,6 +168,18 @@ def test_doesnt_interpret_request_uri_as_query_string_when_missing
|
|||||||
end
|
end
|
||||||
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
|
class CgiRequestNeedsRewoundTest < BaseCgiTest
|
||||||
def test_body_should_be_rewound
|
def test_body_should_be_rewound
|
||||||
data = 'foo'
|
data = 'foo'
|
||||||
|
Loading…
Reference in New Issue
Block a user