Factory already registered: user (FactoryGirl::DuplicateDefinitionError)

后端 未结 27 2266
我在风中等你
我在风中等你 2021-02-06 21:18

Description of problem: - I\'ve setup factory_girl_rails however whenever I try and load a factory it\'s trying to load it multiple times.

Envir         


        
27条回答
  •  余生分开走
    2021-02-06 21:47

    I resolved it by removing spec/factories/xxx.rb from command line:

    rspec spec/factories/xxx.rb spec/model/xxx.rb # before
    rspec spec/model/xxx.rb # after
    

提交回复
热议问题