diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-07-21 16:12:14 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-07-21 16:12:14 +0300 |
commit | 2f413f422ac43bd7d26598f857a81a61cb099557 (patch) | |
tree | b209d14a544e59d361380ac414f23a8a453791a2 | |
parent | d162188dd662a7d9f62ba8431474f50bc35e3e93 (diff) | |
download | rails-2f413f422ac43bd7d26598f857a81a61cb099557.tar.gz rails-2f413f422ac43bd7d26598f857a81a61cb099557.tar.bz2 rails-2f413f422ac43bd7d26598f857a81a61cb099557.zip |
Clarify example of the test `ActionController::HttpAuthentication::Token` [ci skip]
Follow up #33401, 5491f8115711d8b34d52f8ba5e52ba39a49b08fe.
-rw-r--r-- | actionpack/lib/action_controller/metal/http_authentication.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/metal/http_authentication.rb b/actionpack/lib/action_controller/metal/http_authentication.rb index 51d25ac1e0..a871ccd533 100644 --- a/actionpack/lib/action_controller/metal/http_authentication.rb +++ b/actionpack/lib/action_controller/metal/http_authentication.rb @@ -390,10 +390,9 @@ module ActionController # In your integration tests, you can do something like this: # # def test_access_granted_from_xml - # get( - # "/notes/1.xml", nil, - # 'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Token.encode_credentials(users(:dhh).token) - # ) + # authorization = ActionController::HttpAuthentication::Token.encode_credentials(users(:dhh).token) + # + # get "/notes/1.xml", headers: { 'HTTP_AUTHORIZATION' => authorization } # # assert_equal 200, status # end |