Standup 08/27/2008

edit Posted by Jim Kingdon on Wednesday August 27, 2008 at 04:26PM

  • Does anyone have any experiences with one of the object mother libraries like object daddy? (Answers at standup were "no, we always wrote our own object mothers in a domain-specific way"). The appeal of a library is that it might help keep track of what needs to be done to make an object pass rails validation.

  • Clock.zone now has exists. (Background, pivotal has a Clock class which has a now method which can be implemented either by a call to Time.now for production, or a mock clock which lets tests specify the "time"). This is so that the rails 2.1 features like Time.zone.now have an analog in Clock.

Comments

  1. Aaron Aaron on August 28, 2008 at 12:38AM

    I've been using Object Daddy on UD and I dig it. For each model you write a separate "exemplar" that knows how to generate valid values for each field with validations. I did run into a few problems with attr_protected fields, primary keys that aren't named "id", and validations that look at multiple fields.

    I'd love to remove all my fixtures and replace them with Model.generate! calls!

Add a Comment (MarkDown available)