Sha256: 08ab7c553273c237d5d641f4964b67f9aff55b560d8487218f8df9130890d319

Contents?: true

Size: 882 Bytes

Versions: 50

Compression:

Stored size: 882 Bytes

Contents

FactoryBot.define do

  factory :guide do
    sequence(:name) { |n| "guide#{n}" }
    locale { 'en' }
    description { 'A Guide' }
    slug { "flbulgarelli/mumuki-sample-guide-#{SecureRandom.uuid}" }
    language
  end

  trait :guide_container do
    transient do
      exercises { [] }
      name { Faker::Lorem.sentence(3) }
      description { Faker::Lorem.sentence(10) }
      language { create(:language) }
      slug { "mumuki/mumuki-test-lesson-#{SecureRandom.uuid}" }
    end

    after(:build) do |lesson, evaluator|
      lesson.guide = build(:guide,
                           name: evaluator.name,
                           slug: evaluator.slug,
                           exercises: evaluator.exercises,
                           description: evaluator.description,
                           language: evaluator.language) unless evaluator.guide
    end
  end

end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
mumuki-laboratory-7.0.12 vendor/bundle/ruby/2.3.0/bundler/gems/mumuki-domain-74da3d4af98c/lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-7.0.6 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-7.0.5 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-7.0.4 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-7.0.3 lib/mumuki/domain/factories/guide_factory.rb
mumuki-laboratory-7.0.11 vendor/bundle/ruby/2.3.0/bundler/gems/mumuki-domain-f892f79c60f0/lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-7.0.2 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-7.0.1 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-7.0.0 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-6.7.2 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-6.7.1 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-6.7.0 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-6.6.2 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-6.6.1 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-6.6.0 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-6.5.1 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-6.5.0 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-6.4.3 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-6.4.2 lib/mumuki/domain/factories/guide_factory.rb
mumuki-domain-6.4.1 lib/mumuki/domain/factories/guide_factory.rb