/features/digest_authentication.feature

http://github.com/jnunemaker/httparty · Gherkin Specification · 30 lines · 26 code · 4 blank · 0 comment · 0 complexity · 648f448aa05efaccdead99a8f24cd03e MD5 · raw file

  1. Feature: Digest Authentication
  2. As a developer
  3. I want to be able to use a service that requires Digest Authentication
  4. Because that is not an uncommon requirement
  5. Scenario: Passing no credentials to a page requiring Digest Authentication
  6. Given a restricted page at '/digest_auth.html'
  7. When I call HTTParty#get with '/digest_auth.html'
  8. Then it should return a response with a 401 response code
  9. Scenario: Passing proper credentials to a page requiring Digest Authentication
  10. Given a remote service that returns 'Digest Authenticated Page'
  11. And that service is accessed at the path '/digest_auth.html'
  12. And that service is protected by Digest Authentication
  13. And that service requires the username 'jcash' with the password 'maninblack'
  14. When I call HTTParty#get with '/digest_auth.html' and a digest_auth hash:
  15. | username | password |
  16. | jcash | maninblack |
  17. Then the return value should match 'Digest Authenticated Page'
  18. Scenario: Passing proper credentials to a page requiring Digest Authentication using md5-sess algorithm
  19. Given a remote service that returns 'Digest Authenticated Page Using MD5-sess'
  20. And that service is accessed at the path '/digest_auth.html'
  21. And that service is protected by MD5-sess Digest Authentication
  22. And that service requires the username 'jcash' with the password 'maninblack'
  23. When I call HTTParty#get with '/digest_auth.html' and a digest_auth hash:
  24. | username | password |
  25. | jcash | maninblack |
  26. Then the return value should match 'Digest Authenticated Page Using MD5-sess'