aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2010-01-15 12:35:18 -0600
committerJoshua Peek <josh@joshpeek.com>2010-01-15 12:38:50 -0600
commit3eaf525213ccef5c63c9e296fa643ad416a3f84c (patch)
treef7ab86f8622fc7ce1247377134195bf9eac2b2b0 /actionpack/test/dispatch
parent43a84a054f51f260e1d4a9d4be75783e497a3398 (diff)
downloadrails-3eaf525213ccef5c63c9e296fa643ad416a3f84c.tar.gz
rails-3eaf525213ccef5c63c9e296fa643ad416a3f84c.tar.bz2
rails-3eaf525213ccef5c63c9e296fa643ad416a3f84c.zip
Make HEAD method masquerade as GET so requests are routed correctly
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/request_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb
index b62df9a6b2..cb95ecea50 100644
--- a/actionpack/test/dispatch/request_test.rb
+++ b/actionpack/test/dispatch/request_test.rb
@@ -319,7 +319,7 @@ class RequestTest < ActiveSupport::TestCase
end
test "allow method hacking on post" do
- [:get, :head, :options, :put, :post, :delete].each do |method|
+ [:get, :options, :put, :post, :delete].each do |method|
request = stub_request "REQUEST_METHOD" => method.to_s.upcase
assert_equal(method == :head ? :get : method, request.method)
end
@@ -341,7 +341,7 @@ class RequestTest < ActiveSupport::TestCase
end
test "head masquerading as get" do
- request = stub_request 'REQUEST_METHOD' => 'HEAD'
+ request = stub_request 'REQUEST_METHOD' => 'GET', "rack.methodoverride.original_method" => "HEAD"
assert_equal :get, request.method
assert request.get?
assert request.head?