railstutorial.org - undefined method `Factory'

前端 未结 10 1651
时光取名叫无心
时光取名叫无心 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条回答
  •  萌比男神i
    2021-02-14 08:35

    Maybe you should try the new syntax (see github readme of factory girl)

    FactoryGirl.define :user do |user|
      user.name                  "Michael Hartl"
      user.email                 "mhartl@example.com"
      user.password              "foobar"
      user.password_confirmation "foobar"
    end
    

提交回复
热议问题