[rspec-users] ordering dependency in tests?

Fearless Fool lists at ruby-forum.com
Thu Feb 24 14:24:19 EST 2011

@Pat:  thanks for the suggestions.

It's perhaps not only what David suggested -- I seem to be suffering 
from some cached AR value.  I changed my constant declaration to:

  RESIDENTIAL = find_or_create_by_name("residential")

This keeps the number of instances down to a 1.  That's good.  But if I 
put this in the setup of my test:


I get


Since my setup code is pushing elements onto @premise_group.premises, I 
can see that this would cause trouble when @premise_group is written out 
to the DB.  My head hurts just thinking about where I need to sprinkle 
reload() statements in my code -- maybe the coffee will kick in and 
clarity will result.

Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list