[rspec-users] RSpec and PostgreSQL not playing nicely together

Mark Wilden mark at mwilden.com
Tue Nov 4 17:15:06 EST 2008


On Tue, Nov 4, 2008 at 1:10 PM, Fernando Perez <lists at ruby-forum.com> wrote:

> Thanks Ashley. And I am sure I will forget to run migration for the test
> environment each time I make changes to it. I will create a dumb script
> that looks like:
> --
> RAILS_ENV=production rake db:migrate
> RAILS_ENV=test rake db:migrate
>

I think it's actually simpler to do 'rake db:test:prepare' rather than
migrate the test database. Migrations can be a pain when you've only got one
database to worry about, much less two. The db:test:prepare task extracts
the schema from the development database, drops the test database, then
builds it again with the schema script. One reason I like it is that I know
for sure that my tests are starting from a known state - empty. The other is
that I know for sure that the test db matches the dev db.

///ark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081104/d8f1c0f8/attachment.html>


More information about the rspec-users mailing list