pahanix & IT

yet another passionate programmer

0 notes &

Writing Good Factories

I really wanted to remember what Pratik had to say about writing good factories in his Rails Summit talk so I’m putting it up here as a reference.
  1. Should be able to loop
    10.times { Factory(:user) }
  2. No associations in the base Factory
    Factory(:user) and Factory(:user_with_items)
  3. Should pass validations

Filed under ruby tips