Sha256: 8856f12f9b02c84091cfb0ea36d2ee0f6604ed181768a6d35933aaab8b552ec3

Contents?: true

Size: 1006 Bytes

Versions: 10

Compression:

Stored size: 1006 Bytes

Contents

FactoryGirl.define do

  factory :program, class: Gaku::Program do
    name { Faker::Education.degree }
    description 'Superior Ruby Skills'
    school
  end

  trait :full_program do |resource|
    resource.after(:build) do |program|
      level = create(:level)
      syllabus = create(:syllabus)
      specialty = create(:specialty)
      create(:program_level, level: level, program: program)
      create(:program_syllabus, level: level, program: program, syllabus: syllabus)
      create(:program_specialty, specialty: specialty, program: program)
    end
  end

  trait :with_program_level do |resource|
    resource.after(:build) do |program|
      program.levels << create(:level)
    end
  end

  trait :with_program_syllabus do |resource|
    resource.after(:build) do |program|
      program.syllabuses << create(:syllabus)
    end
  end

  trait :with_program_specialty do |resource|
    resource.after(:build) do |program|
      program.specialties << create(:specialty)
    end
  end

end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
gaku-0.2.4 core/lib/gaku/testing/factories/program_factory.rb
gaku_core-0.2.4 lib/gaku/testing/factories/program_factory.rb
gaku-0.2.3 core/lib/gaku/testing/factories/program_factory.rb
gaku_core-0.2.3 lib/gaku/testing/factories/program_factory.rb
gaku-0.2.2 core/lib/gaku/testing/factories/program_factory.rb
gaku_core-0.2.2 lib/gaku/testing/factories/program_factory.rb
gaku-0.2.1 core/lib/gaku/testing/factories/program_factory.rb
gaku_core-0.2.1 lib/gaku/testing/factories/program_factory.rb
gaku-0.2.0 core/lib/gaku/testing/factories/program_factory.rb
gaku_core-0.2.0 lib/gaku/testing/factories/program_factory.rb