Sha256: 2ac8f9e6316a1566a2fcc82b79fab6c21438324c4a2b1b538718e85fe1ce1505

Contents?: true

Size: 832 Bytes

Versions: 4

Compression:

Stored size: 832 Bytes

Contents

# Read about factories at https://github.com/thoughtbot/factory_girl

FactoryGirl.define do
  factory :mno_enterprise_org_invite, :class => 'MnoEnterprise::OrgInvite' do
    
    factory :org_invite, class: MnoEnterprise::OrgInvite do
      sequence(:id) 
      sequence(:token) { |n| "dfhsohflsklddfdsJDasldnjsaHsnjdlsa#{n}" } 
      sequence(:user_email) { |n| "jack.doe#{n}@maestrano.com" }
      status "pending"
      user { build(:user).attributes }
      organization { build(:organization).attributes }
      referrer { build(:user).attributes }
      team { build(:team).attributes }
      user_role 'Member'
      
      created_at 3.days.ago
      updated_at 1.hour.ago
      
      # Properly build the resource with Her
      initialize_with { new(attributes).tap { |e| e.clear_attribute_changes! } }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mno-enterprise-core-3.0.1 lib/mno_enterprise/testing_support/factories/org_invite.rb
mno-enterprise-core-2.0.1 lib/mno_enterprise/testing_support/factories/org_invite.rb
mno-enterprise-core-3.0.0 lib/mno_enterprise/testing_support/factories/org_invite.rb
mno-enterprise-core-2.0.0 lib/mno_enterprise/testing_support/factories/org_invite.rb