On 19.2.2008, at 12.32, Fernando Perez wrote:
Andrew,By testing your views before the controllers and models, aren't you wasting time on adjusting tests as you make changes to the views? I see many people postpone the testing of views to the very late stage of development, so that they don't get distracted.
One of the founding principles of BDD is the concept of "outside in". In Rails that naturally means the process Andrew described. By starting from what your views need, you have a better understanding of what you need from the controller action and related models, so you have a good foundation from where you start speccing them when you drill down towards the core.
That also follows one of the 37signals' mantras that is worth repeating: "the interface is the application".
If changing some small things (like a <p> to <div>) in the views breaks your specs, you're probably speccing wrong things. I always try to spec for logical things, not the actual tags, for example. That is not always an option, of course.
//jarkko -- Jarkko Laine http://jlaine.net http://dotherightthing.com http://www.railsecommerce.com http://odesign.fi
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users