I have a naked rails 3 app with one model, generated using rails g model User.
rails g model User
I\'ve added a factory (using factory_girl_rails):
factory_girl_rails
try this out:
For rails version > 4.1+ this solution will work as the current scenario. but in Rails 4.1+, rake db:test:prepare is deprecated.
try using
rake db:migrate RAILS_ENV=test (it will work for all version of rails)