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 ...

Get RailsSpace: Building a Social Networking Website with Ruby on Rails™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.