FactoryGirl에서 내 보호 속성 user.confirmed
을 설정하지 않습니다. 가장 좋은 방법은 무엇입니까?FactoryGirl로 보호 속성 설정
Factory.define :user do |f|
f.name "Tim" # attr_accessible -- this works
f.confirmed true # attr_protected -- doesn't work
end
내 공장을 사용한 후 @user.confirmed = true
을 할 수 있지만,이 테스트의 많은 걸쳐 반복의 많은입니다.
그레이트를 찾았습니다. 더 최근의 공장 소녀 버전은 구문을'after (: create)'로 변경했습니다. [시작 안내서] (https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md)를 참조하십시오. –