Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After Rails 3 upgrade rake db:test:prepare not working?

I have just gone through the process of upgrading a Rails 2.3.11 app that uses Test Unit to Rails 3.1.rc4 and I have now set up rspec-rails 2.6.1.

I also switch the test connection in database.yml to use sqlite instead of postgres.

I can run rake db:migrate and db:test:prepare all day, but in my model tests I get "Could not find table 'model_name'".

Has anyone else ran into this?

like image 486
CountCet Avatar asked Jul 01 '11 17:07

CountCet


1 Answers

I did encounter this before. Try rebuilding it from scratch:

rake db:drop RAILS_ENV=test
rake db:create RAILS_ENV=test
rake db:migrate RAILS_ENV=test
like image 109
Jonathan Lin Avatar answered Oct 03 '22 02:10

Jonathan Lin