0

I installed Rails + Spork + Minitest + Autotest as shown by S. Christoffer Eliesen in how-to-combine-autotest-and-spork-in-rails-testing and it works great for tests that doesn't involve the database. It doesn't work if I add a model though:

rails g scaffold post name:string
rake db:migrate

It then gives me the following error:

ActiveRecord::StatementInvalid: Could not find table 'posts'

How can I make it "see" the database/table changes?

Community
  • 1
  • 1
Manuel
  • 10,869
  • 14
  • 55
  • 86

1 Answers1

1

You need to run the migration in the test environment as well.

rake db:migrate RAILS_ENV=test
Tomdarkness
  • 3,800
  • 2
  • 21
  • 26