1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00
httparty/features/basic_authentication.feature
Don Petersen 2febfe3c83 Cucumber features and steps for most functionality as of the 0.2.8
version.  No features for the CLI yet.

Signed-off-by: John Nunemaker <nunemaker@gmail.com>
2009-01-29 17:12:03 +08:00

20 lines
953 B
Gherkin

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