Sha256: 58d022eb2df49a73985534b374a68d41dafa676777ebb0daf42a0f044b7e482e
Contents?: true
Size: 1.33 KB
Versions: 10
Compression:
Stored size: 1.33 KB
Contents
FactoryGirl.define do factory :student, class: Gaku::Student do name { Faker::Name.first_name } middle_name { Faker::Name.first_name } surname { Faker::Name.last_name } name_reading { Faker::Name.first_name } surname_reading { Faker::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
10 entries across 10 versions & 2 rubygems