Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cucumber suite sends unique requests

Helpful for testing ephemeral response
  • Loading branch information...
commit d018df223cba3e762563cdde9479d2cbda82f4c9 1 parent d160df6
@sandro sandro authored
View
8 features/basic_authentication.feature
@@ -5,16 +5,16 @@ Feature: 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'
+ Given a restricted page at '/basic_auth.html'
+ When I call HTTParty#get with '/basic_auth.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 accessed at the path '/basic_auth.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:
+ When I call HTTParty#get with '/basic_auth.html' and a basic_auth hash:
| username | password |
| jcash | maninblack |
Then the return value should match 'Authenticated Page'
View
12 features/deals_with_http_error_codes.feature
@@ -7,20 +7,20 @@ Feature: Deals with HTTP error codes
Scenario: A response of '404 - Not Found'
Given a remote service that returns a 404 status code
- And that service is accessed at the path '/service.html'
- When I call HTTParty#get with '/service.html'
+ And that service is accessed at the path '/404_service.html'
+ When I call HTTParty#get with '/404_service.html'
Then it should return a response with a 404 response code
Scenario: A response of '500 - Internal Server Error'
Given a remote service that returns a 500 status code
- And that service is accessed at the path '/service.html'
- When I call HTTParty#get with '/service.html'
+ And that service is accessed at the path '/500_service.html'
+ When I call HTTParty#get with '/500_service.html'
Then it should return a response with a 500 response code
Scenario: A non-successful response where I need the body
Given a remote service that returns a 400 status code
And the response from the service has a body of 'Bad response'
- And that service is accessed at the path '/service.html'
- When I call HTTParty#get with '/service.html'
+ And that service is accessed at the path '/400_service.html'
+ When I call HTTParty#get with '/400_service.html'
Then it should return a response with a 400 response code
And the return value should match 'Bad response'
View
8 features/digest_authentication.feature
@@ -5,16 +5,16 @@ Feature: Digest Authentication
Because that is not an uncommon requirement
Scenario: Passing no credentials to a page requiring Digest Authentication
- Given a restricted page at '/protected.html'
- When I call HTTParty#get with '/protected.html'
+ Given a restricted page at '/digest_auth.html'
+ When I call HTTParty#get with '/digest_auth.html'
Then it should return a response with a 401 response code
Scenario: Passing proper credentials to a page requiring Digest Authentication
Given a remote service that returns 'Digest Authenticated Page'
- And that service is accessed at the path '/protected.html'
+ And that service is accessed at the path '/digest_auth.html'
And that service is protected by Digest Authentication
And that service requires the username 'jcash' with the password 'maninblack'
- When I call HTTParty#get with '/protected.html' and a digest_auth hash:
+ When I call HTTParty#get with '/digest_auth.html' and a digest_auth hash:
| username | password |
| jcash | maninblack |
Then the return value should match 'Digest Authenticated Page'
View
8 features/handles_compressed_responses.feature
@@ -7,13 +7,13 @@ Feature: Handles Compressed Responses
Scenario: Supports deflate encoding
Given a remote deflate service
And the response from the service has a body of '<h1>Some HTML</h1>'
- And that service is accessed at the path '/service.html'
- When I call HTTParty#get with '/service.html'
+ And that service is accessed at the path '/deflate_service.html'
+ When I call HTTParty#get with '/deflate_service.html'
Then the return value should match '<h1>Some HTML</h1>'
Scenario: Supports gzip encoding
Given a remote gzip service
And the response from the service has a body of '<h1>Some HTML</h1>'
- And that service is accessed at the path '/service.html'
- When I call HTTParty#get with '/service.html'
+ And that service is accessed at the path '/gzip_service.html'
+ When I call HTTParty#get with '/gzip_service.html'
Then the return value should match '<h1>Some HTML</h1>'
View
4 features/handles_multiple_formats.feature
@@ -8,9 +8,9 @@ Feature: Handles Multiple Formats
Scenario: An HTML service
Given a remote service that returns '<h1>Some HTML</h1>'
- And that service is accessed at the path '/service.html'
+ And that service is accessed at the path '/html_service.html'
And the response from the service has a Content-Type of 'text/html'
- When I call HTTParty#get with '/service.html'
+ When I call HTTParty#get with '/html_service.html'
Then it should return a String
And the return value should match '<h1>Some HTML</h1>'
View
4 features/supports_redirection.feature
@@ -7,8 +7,8 @@ Feature: Supports Redirection
Scenario: A service that redirects once
Given a remote service that returns 'Service Response'
- And that service is accessed at the path '/service.html'
- And the url '/redirector.html' redirects to '/service.html'
+ And that service is accessed at the path '/landing_service.html'
+ And the url '/redirector.html' redirects to '/landing_service.html'
When I call HTTParty#get with '/redirector.html'
Then the return value should match 'Service Response'
View
4 features/supports_timeout_option.feature
@@ -5,9 +5,9 @@ Feature: Supports the timeout option
Scenario: A long running response
Given a remote service that returns '<h1>Some HTML</h1>'
- And that service is accessed at the path '/service.html'
+ And that service is accessed at the path '/long_running_service.html'
And that service takes 2 seconds to generate a response
When I set my HTTParty timeout option to 1
- And I call HTTParty#get with '/service.html'
+ And I call HTTParty#get with '/long_running_service.html'
Then it should raise a Timeout::Error exception
And I wait for the server to recover
Please sign in to comment.
Something went wrong with that request. Please try again.