This project is archived and is in readonly mode.

#5246 ✓resolved
eydaimon

HttpAuthentication::Basic gives wrong information on example on how to authenticate

Reported by eydaimon | July 30th, 2010 @ 05:51 AM

http://api.rails.info/classes/ActionController/HttpAuthentication/B...

 In your integration tests, you can do something like this:
   def test_access_granted_from_xml
     get(
       "/notes/1.xml", nil,
       :authorization => ActionController::HttpAuthentication::Basic.encode_credentials(users(:dhh).name, users(:dhh).password)
     )

     assert_equal 200, status
   end

This doesn't work. It should read:

 get(
  "/notes/1.xml", nil,
  'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials(users(:dhh).name, users(:dhh).password)
 )

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages