[rspec-users] spec:models depends on development db:migration

Steve vertebrate at gmail.com
Thu Oct 18 12:26:42 EDT 2007


On Thu, 18 Oct 2007 15:51:37 +0100, Keith McDonnell wrote:

> For those interested ....
> 
> rake spec:models seems to clone the test database from development. If 
> your dev db is empty, the models task fails mysteriously.
> 
> Anyway, to make sure your dev db is at the current migration version, I 
> added this dependency in lib/tasks
> 
> task 'spec:models' => 'db:migrate'
> 
> Now the dev db is migrated up with each test pass.
> 
> Keith

Yeah, I was just about to post about this. This seems like incorrect
behavior. Especially if you're really doing behavior driven design. You're
going to be writing your tests and using the test environment first before
you actually go through and use the dev env. When specs are run it should
run all migrations for the test db, not just as far as dev has gone.



More information about the rspec-users mailing list