O'Reilly logo

Rails 4 in Action: Revised Edition of Rails 3 in Action by Ryan Bigg, Yehuda Katz, Steve Klabnik, and Rebecca Skinner

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 2. Testing saves your bacon

This chapter covers

  • Introducing testing approaches
  • Test-driven development with MiniTest
  • Behavior-driven development with RSpec

Chapter 1 presented an extremely basic layout of a Rails application and an example of using the scaffold generator. One question remains, though: how do you make your Rails applications maintainable?

About the scaffold generator

We won’t use the scaffold generator for the rest of the book because people tend to use it as a crutch, and it generates extraneous code. There’s a thread on the rubyonrails-core mailing list where people have discussed the scaffold generator’s downsides: http://mng.bz/g33u.

The answer is that you write automated tests for the ...

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