Spork: how to refresh validations and other code?

前端 未结 4 817
广开言路
广开言路 2020-12-28 07:54

I\'ve been using spork all day, and most of the time it is a really great.

However, I am often running into a few problems where I need to restart Spork in order for

4条回答
  •  不思量自难忘°
    2020-12-28 08:42

    With more recent versions of Factory Girl, you don't need to do much. First, add FactoryGirl.reload in Spork.each_run. If you have factories with the class parameter, they should be string.

    factory :my_model, class: 'MyModel' do...

    instead of

    factory :my_model, class: MyModel do...

提交回复
热议问题