Re: [Rails] Using Factory Girl with has many relationship

2010-09-03 Thread Rick R
On Fri, Sep 3, 2010 at 8:38 AM, Rick R wrote: > On Fri, Sep 3, 2010 at 6:07 AM, Satsou Sa 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.associati

Re: [Rails] Using Factory Girl with has many relationship

2010-09-03 Thread Rick R
On Fri, Sep 3, 2010 at 6:07 AM, Satsou Sa 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 wa

[Rails] Using Factory Girl with has many relationship

2010-09-03 Thread Satsou Sa
Hello, I have this kind of relation: class Article < ActiveRecord::Base has_many :comments end class Comment < ActiveRecord::Base belongs_to :article attr_protected :article_id end The default scenario inside controllers looks like: @article = Article.create(:title => "fo