On 14 Jul 2010, at 18:35, Yiannis wrote:
Any good book or resource to start learning TDD with rails?
But even with all these resources, it’s good to keep in mind there’s
several options for testing your Rails app.
We use RSpec for unit testing, Cucumber + Webrat + Selenium for
integration tests, Factory Girl for factories (instead of fixtures).
It all comes down to what you prefer and all I can say is that I
really don’t prefer the default Rails testing framework.
Also, if you’re not fairly familiar with Rails in the first place, TDD
or BDD may be a bit too much to start off with, especially if test-
first development is completely new for you. I wouldn’t recommend it
to be honest, you’ll probably give up before having something showing
up in your browser.
That said, except on rare occasions where we implement a feature that
we haven’t really fleshed out completely, we develop using BDD. Not
only does it avoid deep nested bugs, but it also keeps you on track,
it’s very tempting to add new “little” features along the way if you
haven’t set a clear path to start off with. By testing first, you work
towards the goal you set and once you achieve that goal, you move on
to adding those nice little extras if there is still a need for them
and you can do so without worrying about breaking what you already have.
Peter De Berdt