我在how-to-combine-autotest-and-spork-in-rails-testing中安装了Rails + Spork + Minitest + Autotest,就像S.ChristoffeEliesen所展示的那样,它对于不涉及数据库的测试非常有效。但是,如果我添加一个模型,它就不起作用了:
rails g scaffold post name:string
rake db:migrate然后,它会给出以下错误:
ActiveRecord::StatementInvalid: Could not find table 'posts'我怎样才能“看到”数据库/表的变化?
发布于 2012-07-30 10:38:39
您还需要在测试环境中运行迁移。
rake db:migrate RAILS_ENV=testhttps://stackoverflow.com/questions/11714708
复制相似问题