Skip to content

Instantly share code, notes, and snippets.

@ajsharp
Created October 2, 2009 19:50
Show Gist options
  • Save ajsharp/200044 to your computer and use it in GitHub Desktop.
Save ajsharp/200044 to your computer and use it in GitHub Desktop.
# visit.rb
Factory.define :visit do |f|
f.patient { |a| a.association(:patient) }
f.clinic { |a| a.association(:clinic) }
end
# patient.rb
# Defines a new sequence
Factory.sequence :email do |n|
"person#{n}@example.com"
end
Factory.define :patient do |f|
f.name "Patient Name"
f.email { Factory.next(:email) }
end
# clinic.rb
Factory.define :clinic do |f|
f.attribute_name "attribute value"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment