Sha256: 590653db4416e550c8f8d93ce93868ee004c056cea8877ada4d2cde49545bfe2
Contents?: true
Size: 1.07 KB
Versions: 77
Compression:
Stored size: 1.07 KB
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(word_count: 3) } description { Faker::Lorem.sentence(word_count: 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 factory :indexed_guide, parent: :guide do after(:build) do |guide| create(:lesson, guide: guide, topic: create(:indexed_topic)) reindex_current_organization! end end end
Version data entries
77 entries across 77 versions & 2 rubygems