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 3Test-Driven Rails

In the previous chapter we created some basic functionality for a project-management application using test-driven development. The title of this book, though, is Rails 4 Test Prescriptions, not Generic Test Prescriptions. (As with most generics, if that book did exist, it’d probably be cheaper but with less-interesting packaging.)

In this chapter we will augment our model testing by testing logic in the controller and view layers, and we’ll implement tests that cover our entire Rails application from request to response, called end-to-end tests. We’ll be using a tool called Capybara to help manage our end-to-end testing.

A good test suite consists of a few end-to-end tests, a lot of tests that target a single unit, ...

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