On Fri, Feb 29, 2008 at 5:33 PM, David Beckwith <[EMAIL PROTECTED]> wrote: > Hi, > > In the spirit of "outside-in" are given-when-then scenarios supposed to be > integration tests of views?
Do you mean "through views?" - i.e. view down to the db? If so, that is one part of the picture. > Or should we be accessing the model interfaces > directly (not through a view)? Why is this an either/or question? I think it depends on the nature of the story. If the story is about transferring money from checking to savings, then the domain objects are fair game. If the story talks about an error message, or some sort of user experience, then go through the views. What I try to do when dealing with views, though, is keep things as high level and general as I can while respecting the requirements. For example, you're more likely to see "When I go to the list of employees" than "When I go to /employees." Or "When I enter David for Name" rather than "When I fill in the Name field with David." The reason is that "When I enter David for Name" can be talking about a web interface, a desktop interface, a batch job or a command line interface. If you think of :steps_for as a factory, because the step definitions are decoupled from the scenarios, you can use the same scenarios to drive steps that go through any of these different UIs, or no UIs at all. HTH, David > > Thanks, > David :) > > > _______________________________________________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users