Search⌘ K
AI Features

External Testing Strategy

Explore how to implement an external testing strategy in Ruby on Rails applications by using adapters to mediate API interactions and the VCR gem to simulate server responses. Learn to write various test types including smoke, integration, client unit, and adapter unit tests, improving test reliability and maintainability when working with external services.

External services 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’s 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 here is outside our application and ...