forked from jnunemaker/httparty
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeals_with_http_error_codes.feature
26 lines (22 loc) · 1.13 KB
/
deals_with_http_error_codes.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Feature: Deals with HTTP error codes
As a developer
I want to be informed of non-successful responses
Because sometimes thing explode
And I should probably know what happened
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'
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'
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'
Then it should return a response with a 400 response code
And the return value should match 'Bad response'