David Kahn wrote:
> On Fri, Oct 8, 2010 at 4:07 PM, Marnen Laibow-Koser 
> <[email protected]>wrote:
> See, your test DB should start out every scenario or test completely
> empty, and only create the records needed for that particular test.  If
> (say) Factory :event also creates a User record for the Event to belong
> to, that's fine -- an Event (in this example) can't exist without an
> owning User, so we need the User in order to test the Event.  We are
> creating all necessary records, but only the necessary records.

For the third time: fix your quoting!

> 
> Right, I fully agree with this. So either I should create the roles in 
> this
> case before each test or let the factories create, either way there is a
> clean slate.

But your Before block is not creating *only* the necessary records for 
each test.  That's why you shouldn't be using it.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to