ArgumentError: Factory not registered

后端 未结 3 760
孤独总比滥情好
孤独总比滥情好 2020-12-14 01:23

I am trying to get factory girl to run with rspec in my rails 4.1.1 app.

Problem is when I run rspec in my command line, i get Failure/Error: vers

3条回答
  •  天涯浪人
    2020-12-14 02:11

    This seems to be an issue with Factory Bot. I fixed it (as per the issue report) with FactoryBot.find_definitions:

    RSpec.configure do |config|
      config.include FactoryBot::Syntax::Methods
    
      config.before do
        FactoryBot.find_definitions
      end
    end
    

提交回复
热议问题