Sha256: 3f9e140c457e49c6b6788f18abe7f54b21b277a698ae8da3ac85e7b5ed35aa1d

Contents?: true

Size: 630 Bytes

Versions: 37

Compression:

Stored size: 630 Bytes

Contents

FactoryBot.define do
  factory :book do
    name { Faker::Lorem.sentence(word_count: 3) }
    description { Faker::Lorem.sentence(word_count: 30) }
    slug { "mumuki/mumuki-test-book-#{SecureRandom.uuid}" }
  end

  factory :book_with_full_tree, parent: :book do
    transient do
      children_factor { 3 }
      exercises { create_list(:exercise, children_factor) }
      lessons { create_list(:lesson, children_factor, exercises: exercises) }
      chapters { create_list(:chapter, children_factor, lessons: lessons) }
    end

    after(:build) do |book, evaluator|
      book.chapters = evaluator.chapters
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
mumuki-domain-9.23.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.22.1 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.22.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.21.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.20.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.19.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.18.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.17.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.16.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.15.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.14.1 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.14.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.13.1 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.13.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.12.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.11.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.10.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.9.0 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.8.1 lib/mumuki/domain/factories/book_factory.rb
mumuki-domain-9.8.0 lib/mumuki/domain/factories/book_factory.rb