I've started learning rails3 few days ago, and since today, every time I run unit test for my model I get this error message:
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such table: users: DELETE FROM "users" WHERE 1=1
The tests went smoothly yesterday, I run them today (reverting everything to the state from the time they were working)... and I'm still getting the error.
I'm using rails 3 release on Windows7 64 bit, SQLite 3.7.2, ruby 187 (but I do have many ruby installations - using pik to select 187)
Any ideas on fixing this issue?
If you created the model using a rails generator, you may have left over fixture files that are trying to access a table that isn't there anymore. For me, deleting the yml file solved the issue.
This was answered here: https://stackoverflow.com/a/6222934
It would be worth checking that your test database is set up correctly using the schema from your development database. You can achieve this with:
rake db:test:prepare
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With