From d018df223cba3e762563cdde9479d2cbda82f4c9 Mon Sep 17 00:00:00 2001 From: Sandro Turriate Date: Wed, 7 Jul 2010 08:54:22 -0400 Subject: [PATCH] Cucumber suite sends unique requests Helpful for testing ephemeral response --- features/basic_authentication.feature | 8 ++++---- features/deals_with_http_error_codes.feature | 12 ++++++------ features/digest_authentication.feature | 8 ++++---- features/handles_compressed_responses.feature | 8 ++++---- features/handles_multiple_formats.feature | 4 ++-- features/supports_redirection.feature | 4 ++-- features/supports_timeout_option.feature | 4 ++-- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/features/basic_authentication.feature b/features/basic_authentication.feature index ee27650..b467237 100644 --- a/features/basic_authentication.feature +++ b/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' diff --git a/features/deals_with_http_error_codes.feature b/features/deals_with_http_error_codes.feature index ccb9912..bd6dd85 100644 --- a/features/deals_with_http_error_codes.feature +++ b/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' diff --git a/features/digest_authentication.feature b/features/digest_authentication.feature index 019cada..456a0a7 100644 --- a/features/digest_authentication.feature +++ b/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' diff --git a/features/handles_compressed_responses.feature b/features/handles_compressed_responses.feature index 4dd0515..b20bba2 100644 --- a/features/handles_compressed_responses.feature +++ b/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 '

Some HTML

' - 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 '

Some HTML

' Scenario: Supports gzip encoding Given a remote gzip service And the response from the service has a body of '

Some HTML

' - 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 '

Some HTML

' diff --git a/features/handles_multiple_formats.feature b/features/handles_multiple_formats.feature index 24c91fa..438a6ba 100644 --- a/features/handles_multiple_formats.feature +++ b/features/handles_multiple_formats.feature @@ -8,9 +8,9 @@ Feature: Handles Multiple Formats Scenario: An HTML service Given a remote service that returns '

Some HTML

' - 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 '

Some HTML

' diff --git a/features/supports_redirection.feature b/features/supports_redirection.feature index 1c1deef..debc7b8 100644 --- a/features/supports_redirection.feature +++ b/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' diff --git a/features/supports_timeout_option.feature b/features/supports_timeout_option.feature index bd007a7..db56463 100644 --- a/features/supports_timeout_option.feature +++ b/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 '

Some HTML

' - 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