O'Reilly logo

RailsSpace: Building a Social Networking Website with Ruby on Rails™ by Aurelius Prochazka, Michael Hartl

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 5. Getting started with testing

If you’ve spent much time developing web applications, you’ve no doubt experienced the pain of making a form handler (for, say, registration), filling it out to test it, making some changes (say, adding some fields), filling it out again, having it break, filling it out again, fixing one problem but having it break for a second unrelated reason, filling it out again—well, you get the idea. What a disaster! What’s a developer to do?

Rails to the rescue! By using automated testing, we don’t have to do any of those things by hand—Rails does them all for us. Rails unit tests let us check our model validations and make sure that the database is working. Functional tests let us simulate a browser hitting 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