title: FactoryGirl: attributes_for not giving me associated attributes
body: <p>I have a Code model factory like this:</p>
  
  <pre><code>Factory.define :code do |f|
      f.value "code"
      f.association :code_type
      f.association(:codeable, :factory =&gt; :portfolio)
  end
  </code></pre>
  
  <p>But when I test my controller with a simple test_should_create_code like this:</p>
  
  <pre><code>  test "should create code" do
      assert_difference('Code.count') do
        post :create, :code =&gt; Factory.attributes_for(:code)
      end
      assert_redirected_to code_path(assigns(:code))
    end
  </code></pre>
  
  <p>... the test fails.  The new record is not created.</p>
  
  <p>In the console, it seems that <code>attributes_for</code> does not return all required attributes like the create does.</p>
  
  <pre><code>rob@compy:~/dev/my_rails_app$ rails console test
  Loading test environment (Rails 3.0.3)
  irb(main):001:0&gt; Factory.create(:code)
  =&gt; #&lt;Code id: 1, code_type_id: 1, value: "code", codeable_id: 1, codeable_type: "Portfolio", created_at: "2011-02-24 10:42:20", updated_at: "2011-02-24 10:42:20"&gt;
  irb(main):002:0&gt; Factory.attributes_for(:code)
  =&gt; {:value=&gt;"code"}
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Thanks,</p>