[rspec-users] Database clearing

Todd Tyree todd at snappl.co.uk
Fri Sep 19 11:44:05 EDT 2008

On Fri, Sep 19, 2008 at 3:42 PM, Mark Wilden <mark at mwilden.com> wrote:

> I don't know the exact mechanism, but if we want a table to be emply that
> might have had fixtures loaded into it at some point, we delete_all in
> before(). It seems to me that if you have fixtures, they would be loaded
> before every test, but you say that you're not seeing that.

Thanks Mark, but it won't work.  The question was more a sanity check when I
first asked it ('have I just not noticed this happening before?'):  I have a
lot of existing specs that rely on the user table--and many of them that
make changes to attributes.  I need to sort out what's going on: calling
delete_all would be just about acceptable if I didn't have go back through
all 800+ specs and try and plumb it in where it was needed.

I've tried paring the setup down one spec and the helper to the bare minimum
(bascially what I sent earlier and a spec helper config that only sets
transactional_fixtures = true) with no luck.  I'm guessing it is probably
some problem with something I've installed or updated recently
(has_many_polymorphs?)  I see several other people have had similar issues,
but there doesn't seem to be one clear cause.  Any thoughts on a good place
to start looking (can clearly see the rollback calls in the test log, but
they don't seem to work right) would be greatly appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080919/43225cb1/attachment.html>

More information about the rspec-users mailing list