Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Spork load locales and factories?

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.

like image 374
fivetwentysix Avatar asked Jul 23 '11 17:07

fivetwentysix


2 Answers

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

like image 163
user930836 Avatar answered Sep 29 '22 02:09

user930836


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

like image 28
macarthy Avatar answered Sep 29 '22 01:09

macarthy