FactoryGirl上的未定义方法“to_i”

时间:2013-01-14 13:58:15

标签: ruby-on-rails ruby factory-bot

将我的铁轨升级到3.11后,我的所有工厂都坏了。

  

失败/错误:有效= Factory.build(:有效,:document_type   => DocumentType :: RG,NoMethodError:未定义的方法to_i' for ["Feminino", 2]:Array # ./spec/support/factories/effetive_factory.rb:10:in块(3级)   在'#./spec/models/effective_spec.rb:20:in`block   (4个级别)在'

effective_factory.rb

# encoding: UTF-8
FactoryGirl.define do
  factory :effective do |e|
    e.document_type DocumentType::RG
    e.rg            "99999999999"
    e.salary_range  1
    e.job           999
    e.emission_date "12/12/1978"
    e.emitter       2
    e.profile       { |p| p.association(:profile) }
    e.quote         { |q| q.association(:quote) }
  end
end

0 个答案:

没有答案