Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
____________
Factory Girl
------------
FactoryGirl.define do
factory :quiz do
title { Factory.next(:name) }
description { Factory.next(:description) }
quiz_type "Practice"
factory :quizWassignments do
quiz_assignments {
Array(0..4).sample.times.map do
Factory.build(:quiz_assignment)
end
}
}
end
end
____________
Fabricator
------------
Fabricator(:quiz) do
title { Factory.next(:name) }
description { Factory.next(:description) }
quiz_type "Practice"
end
Fabricator(:quizWassignments, :from => :quiz) do
quiz_assignments(:count =>2) { Fabricate.build(:quiz_assignment)}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.