/features/basic_authentication.feature

http://github.com/jnunemaker/httparty · Gherkin Specification · 20 lines · 17 code · 3 blank · 0 comment · 0 complexity · a1854e7ee6545d9a60ea9373a10fb48b MD5 · raw file

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