Skip to content

Commit

Permalink
Treat an empty content type as nil content type (issue rack#40) -- tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich Meyers committed Aug 11, 2010
1 parent e70161d commit fbfe78a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/spec_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,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",
Expand Down

0 comments on commit fbfe78a

Please sign in to comment.