Sha256: fcc9604441110f2b09f91fbe610160c3c2503abb2ad6d728f6af37179f096fb3

Contents?: true

Size: 1.08 KB

Versions: 9

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

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

  factory :enterprise_with_okta, parent: :enterprise_account do
    after :create do |enterprise|
      create(
        :okta_saml_provider,
        domain: enterprise.domain,
        enterprise_account_id: enterprise.id,
      )
    end
  end

  factory :enterprise_with_azure, parent: :enterprise_account do
    after :create do |enterprise|
      create(
        :azure_saml_provider,
        domain: enterprise.domain,
        enterprise_account_id: enterprise.id,
      )
    end
  end

  factory :enterprise_with_multiple_providers, parent: :enterprise_account do
    after :create do |enterprise|
      create(
        :okta_saml_provider,
        domain: enterprise.domain,
        enterprise_account_id: enterprise.id,
      )

      create(
        :azure_saml_provider,
        domain: enterprise.domain,
        enterprise_account_id: enterprise.id,
      )
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
osso-0.0.3.5 spec/factories/enterprise_account.rb
osso-0.0.3.4 spec/factories/enterprise_account.rb
osso-0.0.3.3 spec/factories/enterprise_account.rb
osso-0.0.3.2 spec/factories/enterprise_account.rb
osso-0.0.3.1 spec/factories/enterprise_account.rb
osso-0.0.3 spec/factories/enterprise_account.rb
osso-0.0.2.10 spec/factories/enterprise_account.rb
osso-0.0.2.9 spec/factories/enterprise_account.rb
osso-0.0.2.8 spec/factories/enterprise_account.rb