From my completely unscientific survey, it appears a lot of people have still not taken to writing tests for their Rails projects. Mostly because either they don’t know why and how much they should be testing or unfortunately, because they feel overwhelmed by the myriad options: Should I checkout Rspec? or may be Shoulda? what is autotest? Should I learn about mocks and stubs first?
If you are one of those feeling overwhelmed, firstly, don’t feel bad. Here’s a guide about why, what and how of testing for the completely uninitiated. Simplified, especially for you. (The rest of you can scroll over to the next article please).
I will use the Test::Unit framework that comes built-in with Rails and at the end, cover all the other options available.
Read the rest of this article »