Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Treat an empty content type as nil content type (issue #40) -- tests

  • Loading branch information...
commit 672396f0fdaa639981daaf7e6ff309c76f71b352 1 parent 8810d69
@richmeyers richmeyers authored josh committed
Showing with 18 additions and 0 deletions.
  1. +18 −0 test/spec_request.rb
View
18 test/spec_request.rb
@@ -236,6 +236,24 @@
req.user_agent.should.equal nil
end
+ should "treat missing content type as nil" do
+ req = Rack::Request.new \
+ Rack::MockRequest.env_for("/")
+ req.content_type.should.equal nil
+ end
+
+ should "treat empty content type as nil" do
+ req = Rack::Request.new \
+ Rack::MockRequest.env_for("/", "CONTENT_TYPE" => "")
+ req.content_type.should.equal nil
+ end
+
+ should "return nil media type for empty content type" do
+ req = Rack::Request.new \
+ Rack::MockRequest.env_for("/", "CONTENT_TYPE" => "")
+ req.media_type.should.equal nil
+ end
+
should "cache, but invalidates the cache" do
req = Rack::Request.new \
Rack::MockRequest.env_for("/?foo=quux",
Please sign in to comment.
Something went wrong with that request. Please try again.