How to make Spork load locales and factories?
Asked Answered
T

2

5

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.

Tremble answered 23/7, 2011 at 17:56 Comment(0)
B
6

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

Bleachers answered 26/9, 2011 at 14:10 Comment(0)
C
6

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

Claudicant answered 24/7, 2011 at 11:1 Comment(0)
B
6

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

Bleachers answered 26/9, 2011 at 14:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.