Sha256: ec4b4ee7bf9f7705694f617d84c5e84532c16fe029fa007a37a87fdaca9b2e82

Contents?: true

Size: 936 Bytes

Versions: 2

Compression:

Stored size: 936 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 1.days.ago
      updated_at 1.hour.ago
      notification_sent_at 1.hour.ago
      
      # Properly build the resource with Her
      initialize_with { new(attributes).tap { |e| e.clear_attribute_changes! } }

      trait :expired do
        created_at 1.month.ago
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mno-enterprise-core-3.4.0 lib/mno_enterprise/testing_support/factories/org_invite.rb
mno-enterprise-core-3.3.3 lib/mno_enterprise/testing_support/factories/org_invite.rb