aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorGuo Xiang Tan <tgx_world@hotmail.com>2014-07-08 23:27:59 +0800
committerGuo Xiang Tan <tgx_world@hotmail.com>2014-07-18 14:44:49 +0800
commit6c5f1692eea160f6f967d71eaca478ccfef19df8 (patch)
treefdcfd2ae3041f4edff95924791a36ce9f3b1e776 /actionpack
parente0c6b35dac32b6375c86d93e992a138dd627157e (diff)
downloadrails-6c5f1692eea160f6f967d71eaca478ccfef19df8.tar.gz
rails-6c5f1692eea160f6f967d71eaca478ccfef19df8.tar.bz2
rails-6c5f1692eea160f6f967d71eaca478ccfef19df8.zip
Update outdated test.
The current test is asserting against an outdated version of Request#method where HEAD requests are treated as GET requests.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/dispatch/request_test.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb
index 9cbd53002b..5d4bd7a224 100644
--- a/actionpack/test/dispatch/request_test.rb
+++ b/actionpack/test/dispatch/request_test.rb
@@ -647,12 +647,9 @@ class RequestMethod < BaseRequestTest
end
end
- test "allow method hacking on post" do
- %w(GET OPTIONS PATCH PUT POST DELETE).each do |method|
- request = stub_request 'REQUEST_METHOD' => method.to_s.upcase
-
- assert_equal(method == "HEAD" ? "GET" : method, request.method)
- end
+ test "method returns original value of environment request method on POST" do
+ request = stub_request('rack.methodoverride.original_method' => 'POST')
+ assert_equal 'POST', request.method
end
test "invalid method hacking on post raises exception" do