We use VCR to wrap around the API.
https://github.com/vcr/vcr It's pretty straightforward. You put a VCR block around the part of your test that requests the external resource, and then you just make a normal request inside your test. The first time it runs, VCR will write out a "cassette" for that request, which is just a serialized version of the HTTP traffic response. The next time it runs, you will hit the cassette, not the network. Saves a bunch of time when you are done fiddling with the API tests and have moved on to other parts of your app. If you ever worry about your tests getting away from reality, you can just delete the cassettes and run the test again to refresh them with a newer version.
Walter
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to
rubyonra...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/CADKeJyQfjN6WoE1GeBdVR%3DTqTGMS5uOxRYzKRF35eTzUAwdQfQ%40mail.gmail.com.
> For more options, visit
https://groups.google.com/d/optout.