1

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

失败/错误:有效 = Factory.build(:effective, :document_type => DocumentType::RG, NoMethodError: undefined method to_i' for ["Feminino", 2]:Array # ./spec/support/factories/effetive_factory.rb:10:inblock (3 levels) in ' # ./spec/models/effective_spec.rb:20:in `block ( 4 级)在 '

有效工厂.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
4

0 回答 0