Sha256: 7d4a1cd2abb08c20f66b398ce764e4e6d4140c97b26b7f9cc6e1685765115bb5
Contents?: true
Size: 1.35 KB
Versions: 6
Compression:
Stored size: 1.35 KB
Contents
require 'ffaker' FactoryGirl.define do factory :student, class: Gaku::Student do name { FFaker::Name.first_name } middle_name { FFaker::Name.first_name } surname { FFaker::Name.last_name } name_reading { FFaker::Name.first_name } surname_reading { FFaker::Name.last_name } gender true birth_date Date.today end factory :student_with_one_guardian, parent: :student do after(:create) do |student| student.guardians << create(:guardian) student.save end end trait :with_course do after(:create) do |student| student.courses << create(:course) student.save end end trait :with_class_group do after(:create) do |student| student.class_groups << create(:class_group) student.save end end trait :with_extracurricular_activity do after(:create) do |student| student.extracurricular_activities << create(:extracurricular_activity) student.save end end trait :with_enrollment_status do enrollment_status end trait :admitted do association :enrollment_status, factory: :enrollment_status_admitted end trait :applicant do association :enrollment_status, factory: :enrollment_status_applicant end trait :with_scholarship_status do scholarship_status end trait :with_commute_method_type do commute_method_type end end
Version data entries
6 entries across 6 versions & 1 rubygems