Sha256: 43baa7845eae347f5ade27ff20f793f55fa35439181a63704cdf2c86016a3a37

Contents?: true

Size: 1.25 KB

Versions: 6

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :enterprise_account, class: Osso::Models::EnterpriseAccount do
    id { SecureRandom.uuid }
    name { Faker::Company.name }
    domain { Faker::Internet.domain_name }
    oauth_client
  end

  factory :enterprise_with_okta, parent: :enterprise_account do
    after :create do |enterprise|
      create(
        :configured_identity_provider,
        service: 'OKTA',
        domain: enterprise.domain,
        enterprise_account_id: enterprise.id,
      )
    end
  end

  factory :enterprise_with_azure, parent: :enterprise_account do
    after :create do |enterprise|
      create(
        :configured_identity_provider,
        service: 'AZURE',
        domain: enterprise.domain,
        enterprise_account_id: enterprise.id,
      )
    end
  end

  factory :enterprise_with_multiple_providers, parent: :enterprise_account do
    after :create do |enterprise|
      create(
        :configured_identity_provider,
        service: 'OKTA',
        domain: enterprise.domain,
        enterprise_account_id: enterprise.id,
      )

      create(
        :configured_identity_provider,
        service: 'AZURE',
        domain: enterprise.domain,
        enterprise_account_id: enterprise.id,
      )
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
osso-0.0.5.pre.lambda spec/factories/enterprise_account.rb
osso-0.0.5.pre.kappa spec/factories/enterprise_account.rb
osso-0.0.5.pre.iota spec/factories/enterprise_account.rb
osso-0.0.5.pre.theta spec/factories/enterprise_account.rb
osso-0.0.5.pre.eta spec/factories/enterprise_account.rb
osso-0.0.5.pre.zeta spec/factories/enterprise_account.rb