From bd9062971e4b80822bade423c7644bb4eafe492e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=9D=BE?= Date: Fri, 20 Jul 2018 11:26:26 +0800 Subject: [PATCH] Fix basic auth problem in ActionController::HttpAuthentication::Basic doc --- actionpack/lib/action_controller/metal/http_authentication.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_controller/metal/http_authentication.rb b/actionpack/lib/action_controller/metal/http_authentication.rb index 01676f3237cb5..8d53548e681c5 100644 --- a/actionpack/lib/action_controller/metal/http_authentication.rb +++ b/actionpack/lib/action_controller/metal/http_authentication.rb @@ -56,8 +56,8 @@ module HttpAuthentication # In your integration tests, you can do something like this: # # def test_access_granted_from_xml - # @request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(users(:dhh).name, users(:dhh).password) - # get "/notes/1.xml" + # headers = { 'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials(users(:dhh).name, users(:dhh).password } + # get "/notes/1.xml", headers: headers # # assert_equal 200, status # end