PageRenderTime 53ms CodeModel.GetById 32ms app.highlight 0ms RepoModel.GetById 20ms app.codeStats 0ms

/features/supports_redirection.feature

http://github.com/jnunemaker/httparty
Gherkin Specification | 22 lines | 17 code | 4 blank | 1 comment | 0 complexity | 3ce221aa0fc5431d7b0d238936fb638d MD5 | raw file
 1Feature: Supports Redirection
 2
 3  As a developer
 4  I want to work with services that may redirect me
 5  And I want it to follow a reasonable number of redirects
 6  Because sometimes web services do that
 7
 8  Scenario: A service that redirects once
 9    Given a remote service that returns 'Service Response'
10    And that service is accessed at the path '/landing_service.html'
11    And the url '/redirector.html' redirects to '/landing_service.html'
12    When I call HTTParty#get with '/redirector.html'
13    Then the return value should match 'Service Response'
14
15  # TODO: Look in to why this actually fails...
16  Scenario: A service that redirects to a relative URL
17
18  Scenario: A service that redirects infinitely
19    Given the url '/first.html' redirects to '/second.html'
20    And the url '/second.html' redirects to '/first.html'
21    When I call HTTParty#get with '/first.html'
22    Then it should raise an HTTParty::RedirectionTooDeep exception