Sha256: 838ecf3ea4a37a255096940cf3bf88c35c0cb8559e11d8243d8bd560bc4e4b84

Contents?: true

Size: 1 KB

Versions: 43

Compression:

Stored size: 1 KB

Contents

FactoryBot.define do

  factory :organization do
    contact_email { Faker::Internet.email }
    description { 'a great org' }
    locale { 'en' }
    settings {}
    name { 'an-organization' }
    book
  end

  factory :private_organization, parent: :organization do
    name { 'the-private-org' }
  end

  factory :public_organization, parent: :organization do
    public { true }
    name { 'the-public-org' }
    login_methods { Mumukit::Login::Settings.login_methods }
  end

  factory :base, parent: :public_organization do
    name { 'base' }
  end

  factory :test_organization, parent: :public_organization do
    name { 'test' }
    book { create(:book, name: 'test', slug: 'mumuki/mumuki-the-book') }
  end

  factory :another_test_organization, parent: :test_organization, traits: [:skip_unique_name_validation] do
    book { create(:book, name: 'another-test', slug: 'mumuki/mumuki-another-book') }
  end

  trait :skip_unique_name_validation do
    to_create { |instance| instance.save(validate: false) }
  end
end

Version data entries

43 entries across 43 versions & 2 rubygems

Version Path
mumuki-domain-7.10.1 lib/mumuki/domain/factories/organization_factory.rb
mumuki-domain-7.10.0 lib/mumuki/domain/factories/organization_factory.rb
mumuki-laboratory-7.9.2 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-7082a83493eb/lib/mumuki/domain/factories/organization_factory.rb
mumuki-domain-7.9.2 lib/mumuki/domain/factories/organization_factory.rb
mumuki-laboratory-7.9.1 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-b162dc91aa77/lib/mumuki/domain/factories/organization_factory.rb
mumuki-domain-7.9.1 lib/mumuki/domain/factories/organization_factory.rb
mumuki-laboratory-7.9.0 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-520f859ca8af/lib/mumuki/domain/factories/organization_factory.rb
mumuki-domain-7.9.0 lib/mumuki/domain/factories/organization_factory.rb
mumuki-domain-7.7.3 lib/mumuki/domain/factories/organization_factory.rb
mumuki-domain-7.8.1 lib/mumuki/domain/factories/organization_factory.rb
mumuki-domain-7.8.0 lib/mumuki/domain/factories/organization_factory.rb
mumuki-domain-7.7.2 lib/mumuki/domain/factories/organization_factory.rb
mumuki-domain-7.7.1 lib/mumuki/domain/factories/organization_factory.rb
mumuki-laboratory-7.7.1 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-cb7a9018bb94/lib/mumuki/domain/factories/organization_factory.rb
mumuki-laboratory-7.7.0 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-cb7a9018bb94/lib/mumuki/domain/factories/organization_factory.rb
mumuki-domain-7.7.0 lib/mumuki/domain/factories/organization_factory.rb
mumuki-domain-7.6.1 lib/mumuki/domain/factories/organization_factory.rb
mumuki-domain-7.6.0 lib/mumuki/domain/factories/organization_factory.rb
mumuki-laboratory-7.5.2 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-ad16a5930cec/lib/mumuki/domain/factories/organization_factory.rb
mumuki-laboratory-7.5.1 vendor/bundle/ruby/2.3.0/bundler/gems/mumuki-domain-a059418e5fd8/lib/mumuki/domain/factories/organization_factory.rb