Sha256: aee0ba1bae8425479345e473c1f65c21fc4bdb2418ea090ca67ffc5e8a7eb5b7

Contents?: true

Size: 1.82 KB

Versions: 4

Compression:

Stored size: 1.82 KB

Contents

# frozen_string_literal: true

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
FactoryBot.define do
  factory :contact do
    user
    lead
    assigned_to         { nil }
    reports_to          { nil }
    first_name          { FFaker::Name.first_name }
    last_name           { FFaker::Name.last_name }
    access              { "Public" }
    title               { FactoryBot.generate(:title) }
    department          { FFaker::Name.name + " Dept." }
    source              { %w[campaign cold_call conference online referral self web word_of_mouth other].sample }
    email               { FFaker::Internet.email }
    alt_email           { FFaker::Internet.email }
    phone               { FFaker::PhoneNumber.phone_number }
    mobile              { FFaker::PhoneNumber.phone_number }
    fax                 { FFaker::PhoneNumber.phone_number }
    blog                { FactoryBot.generate(:website) }
    facebook            { FactoryBot.generate(:website) }
    linkedin            { FactoryBot.generate(:website) }
    twitter             { FactoryBot.generate(:website) }
    do_not_call         { false }
    born_on             { "1992-10-10" }
    background_info     { FFaker::Lorem.paragraph[0, 255] }
    deleted_at          { nil }
    updated_at          { FactoryBot.generate(:time) }
    created_at          { FactoryBot.generate(:time) }
  end

  factory :contact_opportunity do
    contact
    opportunity
    role                { "foo" }
    deleted_at          { nil }
    updated_at          { FactoryBot.generate(:time) }
    created_at          { FactoryBot.generate(:time) }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fat_free_crm-0.20.1 spec/factories/contact_factories.rb
fat_free_crm-0.20.0 spec/factories/contact_factories.rb
fat_free_crm-0.19.2 spec/factories/contact_factories.rb
fat_free_crm-0.19.0 spec/factories/contact_factories.rb