PageRenderTime 67ms CodeModel.GetById 34ms app.highlight 1ms RepoModel.GetById 19ms app.codeStats 0ms

/features/deals_with_http_error_codes.feature

http://github.com/jnunemaker/httparty
Gherkin Specification | 26 lines | 22 code | 4 blank | 0 comment | 0 complexity | 50a9d0094bc2e2e64cfc1ac1e83810ca MD5 | raw file
 1Feature: Deals with HTTP error codes
 2
 3  As a developer
 4  I want to be informed of non-successful responses
 5  Because sometimes thing explode
 6  And I should probably know what happened
 7
 8  Scenario: A response of '404 - Not Found'
 9    Given a remote service that returns a 404 status code
10    And that service is accessed at the path '/404_service.html'
11    When I call HTTParty#get with '/404_service.html'
12    Then it should return a response with a 404 response code
13
14  Scenario: A response of '500 - Internal Server Error'
15    Given a remote service that returns a 500 status code
16    And that service is accessed at the path '/500_service.html'
17    When I call HTTParty#get with '/500_service.html'
18    Then it should return a response with a 500 response code
19
20  Scenario: A non-successful response where I need the body
21    Given a remote service that returns a 400 status code
22    And the response from the service has a body of 'Bad response'
23    And that service is accessed at the path '/400_service.html'
24    When I call HTTParty#get with '/400_service.html'
25    Then it should return a response with a 400 response code
26    And the return value should match 'Bad response'