On Sunday 19 June 2005 02:53 pm, Duane Johnson wrote:> On Jun 19, 2005, at 8:22 AM, David Corbin wrote:
> > Is there a way to turn "association type validation" off in
rails?
> >
> > If I have an unsaved Movie object that "has_many" Actor
objects, it
> > complains
> > when I when I do something like this in my UTs:
> >
> > movie.actor << TestActor.new
>
> Is there some reason that you aren''t setting your fixtures to be
> "just right" from the beginning? I don''t usually need
to do what
> your code does because the data is all associated before the Unit
> Test starts.
I''m doing some that don''t shouldn''t involve the
database (other than schema
analysis). Using fixtures generally masks the details of what you''re
testing, versus simply setting it in code.
At least, that''s my experience.
David