title: Rails3 cannot create nest model with has_one DSL
body: <p>I use Rails3.2.8 to do some practice, here is my models:</p>
  
  <pre><code>class Incident &lt; ActiveRecord::Base
    attr_accessible :category, :user, :status, :reference, :location
    belongs_to :user
    has_one :location
    accepts_nested_attributes_for :location
  
    validates_presence_of :location, :user, :category
  
  
  end
  
  class Location &lt; ActiveRecord::Base
    attr_accessible :latitude, :longitude, :street
    belongs_to :incident
  end
  </code></pre>
  
  <p>Here is my test:</p>
  
  <pre><code>require 'spec_helper'
  
  describe Incident do
    before (:each) do
      @user = create(:user, :name =&gt; "user1")
      @incident_data = {:category =&gt; "House Break in", :user =&gt; @user,
                        :location =&gt; {:latitude =&gt; "-28.1940509", :longitude =&gt; "28.0359692",
                                      :street =&gt; "abc name"}}
    end
    describe "After create Incident successfully" do
      it "should create location" do
        incident = Incident.create(@incident_data)
  
        expect(incident.location.latitude).to eq("-28.1940509")
      end
    end
  end
  </code></pre>
  
  <p>What I want to do is to create Location object automatically when creating Incident object. But the test failed by the following reason:</p>
  
  <p>Failure/Error: incident = Incident.new(@incident_data)</p>
  
  <p>ActiveRecord::AssociationTypeMismatch:</p>
  
  <p>Location(#70156311891820) expected, got Hash(#70156307112200)</p>
  
  <p>Any ideas?</p>