guard-migrate icon indicating copy to clipboard operation
guard-migrate copied to clipboard

Run migrations for test environment?

Open cmer opened this issue 7 years ago • 1 comments

Is there a way to run migrations for the test environment as well?

I'm constantly getting:

Migrations are pending. To resolve this issue, run:
        bin/rails db:migrate RAILS_ENV=test

I thought using test_prepare in my Guardfile would do the trick but it doesn't. Perhaps I'm not using it correctly:

guard 'migrate', test_prepare: true do
  watch(%r{^db/migrate/(\d+).+\.rb})
  watch('db/seeds.rb')
end

Thanks!

cmer avatar Mar 09 '17 01:03 cmer

interesting, you do appear to be using it correctly.

  1. if you run rake db:test_prepare at the command line, are you able to run the specs?
  2. Are you seeing the db:test:prepare in the guard output?

glanotte avatar Mar 16 '17 03:03 glanotte