Skip to content

Instantly share code, notes, and snippets.

@metalelf0
Created June 19, 2011 08:37
Show Gist options
  • Save metalelf0/1033984 to your computer and use it in GitHub Desktop.
Save metalelf0/1033984 to your computer and use it in GitHub Desktop.
# person.rb
validates_presence_of :address
# person_factory.rb
Factory.define :person do |p|
p.name 'John'
p.surname 'Doe'
p.association :address
end
# person_spec.rb
it "builds a valid person with factory girl" do
Factory.build(:person).should be_valid
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment