railstutorial.org - undefined method `Factory'

前端 未结 10 1432
时光取名叫无心
时光取名叫无心 2021-02-14 08:06

I\'m attempting to follow railstutorial.org, and am currently on Chapter 7, where you start using factories: http://railstutorial.org/chapters/modeling-and-viewing-users-two#sec

10条回答
  •  遥遥无期
    2021-02-14 08:37

    For those finding this page now: note where you once used "FactoryGirl" you must now use "FactoryBot" in your tests. From the thoughtbot announcement page:

    "We’re renaming factory_girl to factory_bot (and factory_girl_rails to factory_bot_rails). All the same functionality of factory_girl, now under a different name."

    More details here:

    https://robots.thoughtbot.com/factory_bot

提交回复
热议问题