/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

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