[rspec-users] rake db:test:prepare and pending migrations

Mark Wilden mark at mwilden.com
Tue Apr 7 13:56:02 EDT 2009

On Tue, Apr 7, 2009 at 10:44 AM, Scott Taylor <scott at railsnewbie.com> wrote:
> On Apr 7, 2009, at 1:32 PM, James B. Byrne wrote:
>> I have run into a minor glitch and would like to know what others
>> think.  I am working on a test/expectation and as part of the
>> process of debugging I am rolling back db:migrations one step at a
>> time to discover where the problem was introduced.
>> My workflow looks like this:
>> $ cucumber ... feature:xx
>> fail
>> $ rake db:rollback
>> $ rake db:test:prepare
>>  fail ... you have pending migrations.
>> Now, it seems to me that while testing one is interested only in
>> those migrations that have been applied, not which ones are
>> available.  It is nice to be notified that unapplied migrations
>> exist but I am not sure that one should be constrained to apply them
>> to conduct tests.
>> What do others think?
> If you are using git, it might be wiser to create a branch and reset --hard
> back to those migrations.
> Or, use git's bisect, and migrate:reset from a clean db each time

This also might be useful:

More information about the rspec-users mailing list