On Fri, Sep 3, 2010 at 6:07 AM, Satsou Sa <li...@ruby-forum.com> wrote:

> I had tried to write those factories:
>
>  Factory.define :article do |f|
>    f.title "Hello, world"
>  end
>
>  Factory.define :comment do |f|
>    f.content "Awesome!"
>    f.association :article
>  end

I'm still pretty newb, so I could be way off here, but I think you
need to define the factory that represents the association?

Factory.define :comment do |f|
  f.content "Awesome!"
  f.association :article, :factory => :article
end

-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to