diff options
author | Guo Xiang Tan <tgx_world@hotmail.com> | 2014-07-08 23:39:08 +0800 |
---|---|---|
committer | Guo Xiang Tan <tgx_world@hotmail.com> | 2014-07-18 14:46:50 +0800 |
commit | 5e11e414208608b7e43372154493b3e0a184e580 (patch) | |
tree | d178cccb3c400e980d3dbfc392bb780e2db84248 /actionpack | |
parent | 6c5f1692eea160f6f967d71eaca478ccfef19df8 (diff) | |
download | rails-5e11e414208608b7e43372154493b3e0a184e580.tar.gz rails-5e11e414208608b7e43372154493b3e0a184e580.tar.bz2 rails-5e11e414208608b7e43372154493b3e0a184e580.zip |
Update test to clearly reflect what it is testing for.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/dispatch/request_test.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb index 5d4bd7a224..62fc86f6a0 100644 --- a/actionpack/test/dispatch/request_test.rb +++ b/actionpack/test/dispatch/request_test.rb @@ -632,12 +632,14 @@ class RequestProtocol < BaseRequestTest end class RequestMethod < BaseRequestTest - test "request methods" do - [:post, :get, :patch, :put, :delete].each do |method| - request = stub_request('REQUEST_METHOD' => method.to_s.upcase) + test "method returns environment's request method when it has not been + overriden by middleware".squish do - assert_equal method.to_s.upcase, request.method - assert_equal method, request.method_symbol + ActionDispatch::Request::HTTP_METHODS.each do |method| + request = stub_request('REQUEST_METHOD' => method) + + assert_equal method, request.method + assert_equal method.underscore.to_sym, request.method_symbol end end |