Reload factory_girl factory

后端 未结 2 1554
走了就别回头了
走了就别回头了 2021-02-19 10:50

I want that when I make changes in factories, I see them in rails console without restarting all console.

I\'ve found some lines and tested them with a poor understandin

2条回答
  •  面向向阳花
    2021-02-19 11:37

    I was using Faker. See the diff of changes that solved the problem:

    # factories/building.rb, address is a string
    
    - address    Faker::Address.street_address
    + address    { Faker::Address.street_address }
    
    # factories/user.rb, email is a string
    
    - email Faker::Internet.email
    + email { Faker::Internet.email }
    

    And then FactoryGirl.reload works.

提交回复
热议问题