O'Reilly logo

Rails 4 Test Prescriptions by Noel Rappin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

External Testing Strategy

Our external-service testing story has two main characters:

  • The client, the part of our application code that uses the external API, either because it needs data accessible via the API or because it is sending data to the API to be used by somebody else. In either case, we’re dealing with a request and a response, even if the response is just a status code.

  • The server, which for our purposes is outside our application and reachable via some kind of network request (though many of the strategies in this chapter also apply even if the service isn’t separated by the network).

We also introduce two characters to the story for design and testing purposes:

* A fake server, which intercepts HTTP requests during a test and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required