[rspec-users] stepping across features

Andrew Premdas apremdas at gmail.com
Wed Dec 3 09:23:03 EST 2008

Perhaps the creation of the join is not something that should be
tested by a feature. This sounds to me like an implementation detail
that would be better tested by some sort of unit test. So if your
features want to have things in them mentioning joins, databases and
other such things then you're probably using the wrong tool. Joseph
wrote a really good blog post about this sort of stuff




2008/12/2 James Byrne <lists at ruby-forum.com>:
> I am perplexed by a situation that I am creating for myself, probably
> out of ignorance.  I have two models connected through a join table
> which itself contains information related to the join.  I am testing the
> creation of this join.
> I already have step definitions written for one of the outside models
> that include methods to create new records.  I say methods because I
> have broken down the processing to initializing the model instance,
> populating the attributes, and then saving it.
> Now, where I think I may be about to commit a grave error is in the step
> definitions for the features relating to the join model.  Which path
> should I take:
> 1. Call the existing step definitions in the outer model to create a
> test instance? or
> 2. Replicate the effect of those existing steps inside the step
> definition file for the join model and create test instances of the
> outer models completely from within that file.
> Regards,
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list