[rspec-users] outside-in = integration tests on views?

David Chelimsky dchelimsky at gmail.com
Fri Feb 29 19:06:03 EST 2008

On Fri, Feb 29, 2008 at 5:33 PM, David Beckwith <dbitsolutions at gmail.com> 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

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


> Thanks,
> David :)
> _______________________________________________
>  rspec-users mailing list
>  rspec-users at rubyforge.org
>  http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list