【问题标题】:How to update test database in Rails 3?如何在 Rails 3 中更新测试数据库?
【发布时间】:2011-11-14 12:55:22
【问题描述】:

我在模型的 yml 固定装置中添加了一个条目。然后rails console test。但是新记录不在数据库中。

如何“更新”测试数据库以在 Rails 控制台中访问它?

在 Rails 3.0.7 中工作,使用内置单元测试。

谢谢。

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 testing rails-console


    【解决方案1】:

    我会说:

    bundle exec rake db:fixtures:load RAILS_ENV=test
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-13
      • 2011-08-16
      • 1970-01-01
      • 2012-06-28
      相关资源
      最近更新 更多