Thanks.

I guess we disagree on what I want to test :).

It was a simple solution of creating my own rake tasks, instead of
using the pre-built rake tasks.

On Mar 2, 5:14 pm, Phlip <phlip2...@gmail.com> wrote:
> Obelix wrote:
> > Setting up the data for my rails server is non trivial, it includes
> > schema creation, seeding the database with seed data, running indexing
> > using ferret.
>
> > I want to write functional tests that use the seed data and indices.
>
> > However, each time I run the functional tests, the db schema gets
> > dropped and re-created.  Is there a way to preserve existing schema
> > and not re-create it each time?
>
> Then it wouldn't be a test.
>
> You need to test by running each step in the setup for the test for the
> subsequent step. Test seeding by asserting the DB is empty (or by emptying 
> your
> fixtures out!), call the seed method, and assert the database is seeded. Test
> indexing by seeding the database, asserting ferret is unindexed, calling the
> indexer, and asserting ferret can find data. And so on.
>
> Test isolation is very important, and ActiveRecord will fight
> you to preserve it. AR will think that you have simply neglected to tear down
> some database detail, and will diligently tear it down for you!
>
> --
>    Phlip
>    http://www.zeroplayer.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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to