ChapterÂ 10.Â Testing
So far, youâve tested your code by typing in the Rails console and clicking links in the web browser. As you add more features to your application, however, this wonât scale. And even with more effective test methods, youâll still have to remember to retest everything in the application after you add each feature. Otherwise you might miss a regression.
Rather than manually testing your application, you can write automated tests in Ruby to ensure your code is correct and meets all of your requirements. Once you have a set of automated tests in place, you can run an entire suite of tests to catch regressions, helping you to refactor your code with confidence.
Several different test frameworks are available for Ruby. In ...