5

所以在 Rails 3.0.9 应用程序上,我在 1.9.2 上使用 Spork/Guard/RSpec/FactoryGirl。

我想知道如何让 Spork/Guard 自动更新我的工厂和语言环境。

4

2 回答 2

6

在你的 Gemfile

gem "factory_girl_rails", :require => false

然后在 spec/spec_helper.rb

Spork.each_run do
  require 'factory_girl_rails'
end

那应该工作

于 2011-07-24T11:01:19.800 回答
6

对于语言环境,只需I18n.reload!each_run. spec/spec_helper.rb它应该工作。

于 2011-09-26T14:10:31.873 回答