aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-07-16 03:18:09 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-07-16 03:18:35 +0100
commit0f8206104e5dfca1024d1f6bc12a8783c00527e2 (patch)
treef8adfff88375cb9053cc5eec4d1bc61209c5da78 /actionpack/test/controller
parent8b306bf24c53f698cd83f7d616f2478a6efa5797 (diff)
downloadrails-0f8206104e5dfca1024d1f6bc12a8783c00527e2.tar.gz
rails-0f8206104e5dfca1024d1f6bc12a8783c00527e2.tar.bz2
rails-0f8206104e5dfca1024d1f6bc12a8783c00527e2.zip
RackRequest#content_type should return Mime::Type
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/rack_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/rack_test.rb b/actionpack/test/controller/rack_test.rb
index 486fe49737..67ccf1b127 100644
--- a/actionpack/test/controller/rack_test.rb
+++ b/actionpack/test/controller/rack_test.rb
@@ -166,6 +166,18 @@ class RackRequestParamsParsingTest < BaseRackTest
end
end
+class RackRequestContentTypeTest < BaseRackTest
+ 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 RackRequestNeedsRewoundTest < BaseRackTest
def test_body_should_be_rewound
data = 'foo'