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-5.10.4 spec/factories/guide_factory.rb
mumuki-laboratory-5.10.3 spec/factories/guide_factory.rb
mumuki-laboratory-5.10.2 spec/factories/guide_factory.rb
mumuki-laboratory-5.10.1 spec/factories/guide_factory.rb
mumuki-laboratory-5.10.0 spec/factories/guide_factory.rb
mumuki-laboratory-5.9.1 spec/factories/guide_factory.rb
mumuki-laboratory-5.9.0 spec/factories/guide_factory.rb
mumuki-laboratory-5.8.3 spec/factories/guide_factory.rb
mumuki-laboratory-5.8.1 spec/factories/guide_factory.rb
mumuki-laboratory-5.8.0 spec/factories/guide_factory.rb