Effectively Testing Services
summary
Shows actual tactics and results: use webmock to block real network calls, use vcr cassettes to record real responses and detect unexpected diffs, mount a sham_rack Sinatra fake for dynamic responses, and use the Charles proxy or Postman/HTTPie to capture real requests. Demonstrates catching real API failures (array turns into single object, id versus code inconsistencies), handling no-version APIs, and whether recorded responses make tests fast, reliable, and repeatable.
AI-written summary · about
chapters (17)
- 0:00Intro
- 0:46what, why & how railsconf of testing services
- 1:24What is a service?
- 1:46Any time you make an HTTP request to an endpoint in another repository
- 2:42Why is testing services important? You (should) test everything else Services compose crucial features You may encounter problem...
- 3:17Internal API Sometimes null responses Inconsistencies Catastrophe
- 4:50id": 24 "code" : "ANA
- 5:24No versioning!
- 6:35What is different about services? External network requests You don't own the code
- 7:06On an airplane... Failure is bad! No network requests
- 7:41Don't interact with services from test environment
- 8:33Time to stub!
- 9:04Built-in Stubbing Typhoeus Faraday Excon
- 20:03Even Better Record API automatically Replay responses without network Verify responses
- 20:48Additional Build Process Runs outside normal test mode Rechecks cassettes for diffs Avoids versioning issues
- 25:06Bringing it all together Testing services is crucial If in doubt, stub it out Determine the flexibility you want Record responses to save time
- 26:11Next Up Eliminating Inconsistent Test Failures with Austin Putman








