Sha256: 809270a73184edeb7b4f545de54a031429bb314b81413480f512223e512cf4d8

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

FactoryGirl.define do
  factory :person do
    email       { Faker::Internet.email}
    first_name  { Faker::Name.first_name }
    last_name   { Faker::Name.last_name }
    middle_name { Faker::Name.first_name }
    suffix      { rand(100) < 10 ? %w{md sr jr ii iii iv esq pd vd}.sample : "" }
    organization
  end

  factory :individual, :parent => :person, :class => "Individual" do
    type            "Individual"
    subtype         "Individual"
  end

  factory :business, :parent => :person, :class => "Company" do
    type            "Company"
    subtype         "Business"
  end

  factory :foundation, :parent => :business do
    subtype         "Foundation"
  end

  factory :government, :parent => :business do
    subtype         "Government"
  end

  factory :nonprofit, :parent => :business do
    subtype         "Nonprofit"
  end

  factory :other, :parent => :business do
    subtype         "Other"
  end

  factory :person_without_email, :parent => :person do
    email nil
  end

  factory :dummy, :parent => :person do
    dummy true
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
artfully_ose-1.2.0.pre.24 spec/factories/person_factories.rb
artfully_ose-1.2.0.pre.23 spec/factories/person_factories.rb
artfully_ose-1.2.0.pre.21 spec/factories/person_factories.rb
artfully_ose-1.2.0.pre.20 spec/factories/person_factories.rb