Topic: Rake test vs autotest -rails

Lately I've been runing into some very odd problems, either "rake test" or "autotest -rails" can be made to finish my tests without errors, but not both.

I'm trying to isolate a simple example to see if that helps me (or someone else) understand what the heck is going on.  However, so far I haven't been able to get a simple self-contained example and I was wondering if anyone else had encountered this...

Thanks

Last edited by NielsenE (2006-09-01 11:14:47)

My RoR journey  -- thoughts on learning RoR and lessons learned in applying TDD and agile practices.

Re: Rake test vs autotest -rails

On a hunch I just tried removing all my foreign keys, and that brings the two back to a consistent (and passing) state.

It appears that the hacks needed to get fixtures to load/delete properly when there are foreign keys involved are different...

Has anyone here found a solution to managing foreign keys in tests that works in both autotest and rake test?  The initial problem I was having months ago was the order of fixture deletion -- ie rails doesn't do reverse order, thus deletions from the primary table fail if the foreign table doesn't have a "CASCADE or SET NULL" modifier.

In one project, I sas trying out some code that effectively neuters the fixture deletions, and only inserts non-inserted fixtures.  But it seems that it interacts badly with autotest...  I'm not sure why.

In another project, with no tweaking to how fixtures work, I haven't had deletion order problems, but rake test keeps trying to start nested transactions for some reason (which generates an obnoxious warning), while autotest runs cleanly...

My RoR journey  -- thoughts on learning RoR and lessons learned in applying TDD and agile practices.