Iain Davis wrote:
> Hello,
> 
> Hope no one minds me just jumping in here with a question.
> 
> I'm completely new to Ruby on Rails. I've been reading "Simply Rails
> 2", and following their examples. I reached a point where the unit
> tests were unexpectedly failing. Upon investigation, I discovered that
> when Rails loads the fixtures, the foreign keys aren't being populated
> with the foreign record's ID, but instead is simply 0 (discovered this
> by looking at the tables manually).
[...]

Slightly off topic, but: once you finish the tutorial, forget you ever 
heard of fixtures.  For a whole lot of reasons, they represent a poor 
approach to testing.  Use factories instead (I recommend Machinist) and 
your tests will be much less troublesome.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to