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

Chapter 12Testing External Services

We’ve decided the one thing our project-management tool really needs is a bit of graphical spark. Specifically, we’ve been asked to have users’ Twitter avatars show up on the site attached to tasks they have completed. (Handily, Twitter has a Ruby gem that’s not to hard to set up.) Since this is Rails 4 Test Prescriptions and not Rails 4 Connecting to Twitter Prescriptions, we’d like to be able to test our interaction with the Twitter API.

Unfortunately, interacting with a third-party web service introduces a lot of complexity to our testing. Connecting to a web service is slow—even slower than the database connections we’ve already tried to avoid. Plus, connection to a web service requires an Internet connection, ...

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