so is the concept to build up all seed data creation in one place/method, & then for the rake spec case run this in via the "test" environment.rb file?
But then if you were to use rake:migrate to drop back a couple of version you might be in a spot of bother? (ie newest seed data not then tied to migration)? On 11/5/08, Pat Maddox <[EMAIL PROTECTED]> wrote: > "Mark Wilden" <[EMAIL PROTECTED]> writes: > >> On Tue, Nov 4, 2008 at 4:26 PM, Pat Maddox <[EMAIL PROTECTED]> wrote: >> >> aslak's right though in that case too. In your spec_helper, just loop >> over the tables and delete everything, then insert the seed data you >> want, and it should be good to go. >> >> But then Ashley's comment applies: you've got the same facts in two >> places. Best thing is to >> avoid the dependency, if at all possible. > > Sure, but you can encapsulate all that stuff too. When I've done stuff > like this in the past (and on second thought I have done it just as > aslak suggested, I just didn't think of it :) we've created some seed > data builders. Then it becomes a simple matter of SeedData.build_data > to kick off the whole deal. > > Pat > _______________________________________________ > rspec-users mailing list > [email protected] > http://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users
