Testing with Rails - an initial look09 May 2011 | Comments
As I mentioned previously - I have sort of cheating in my Rails learning, by skipping all the testing tasks.
To be perfectly honest, I have a little experience with Test Driven Development and have a little bit of skepticism about it. I mean I can see the value of it, but it looks like it can be an overkill too.
But I’ll keep an open mind and decided to repay the debt. I am now backtracking my way back to those sections about testing that I’ve skipped.
After playing around with testing for awhile tonight - I just realized how nice it is that in Rails - everything is already thought of and provided. Unit test and functional test are out of the box functionalities from Rails. And if they are already provided - we developers shouldn’t have any more excuses not to use them.
Writing tests are quite straight forward. Rails provides a test database (as part of the three environments config) - this will be clean up and rebuild every time testing is run.
I got this feeling a lot in the past 2 months learning Rails: Rails is best practices bundled up nicely.