开发者

How to make Spork load locales and factories?

开发者 https://www.devze.com 2023-03-22 16:37 出处:网络
So on a Rails 3.0.9 app I\'m using Spork/Guard/RSpec/FactoryGirl on 1.9.2. I would like to know how can I get Spork/Guard to automatically update my factories and locales开发者_运维百科.for locales,

So on a Rails 3.0.9 app I'm using Spork/Guard/RSpec/FactoryGirl on 1.9.2.

I would like to know how can I get Spork/Guard to automatically update my factories and locales开发者_运维百科.


for locales, just put I18n.reload! into Spork's each_run section in spec/spec_helper.rb. It should work.


In your Gemfile

gem "factory_girl_rails", :require => false

And then in spec/spec_helper.rb

Spork.each_run do
  require 'factory_girl_rails'
end

That should work

0

精彩评论

暂无评论...
验证码 换一张
取 消