diff --git a/lib/rack/test.rb b/lib/rack/test.rb index e33bf1b7..0b1a2e38 100644 --- a/lib/rack/test.rb +++ b/lib/rack/test.rb @@ -205,7 +205,7 @@ def env_for(path, env) # Stringifying and upcasing methods has be commit upstream env["REQUEST_METHOD"] ||= env[:method] ? env[:method].to_s.upcase : "GET" - if env["REQUEST_METHOD"] == "GET" + if ["GET", "DELETE"].include?(env["REQUEST_METHOD"]) # merge :params with the query string if params = env[:params] params = parse_nested_query(params) if params.is_a?(String) diff --git a/spec/rack/test_spec.rb b/spec/rack/test_spec.rb index 377eb1f9..ae56fe26 100644 --- a/spec/rack/test_spec.rb +++ b/spec/rack/test_spec.rb @@ -540,6 +540,12 @@ def verb describe "#delete" do it_should_behave_like "any #verb methods" + it "does not set a content type" do + delete "/" + + last_request.env['CONTENT_TYPE'].should be_nil + end + def verb "delete" end