guard-migrate
guard-migrate copied to clipboard
Run migrations for test environment?
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!
interesting, you do appear to be using it correctly.
- if you run
rake db:test_prepare
at the command line, are you able to run the specs? - Are you seeing the
db:test:prepare
in the guard output?