Created
June 19, 2011 08:37
-
-
Save metalelf0/1033984 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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