title: In a Rails unit test, how can I get a User fixture to load its associated Profile?
body: <p>In the documentation concerning Fixtures (<a href="http://api.rubyonrails.org/classes/Fixtures.html" rel="noreferrer">http://api.rubyonrails.org/classes/Fixtures.html</a>) they provide the following example of using label references for associations:</p>
  
  <pre><code>### in pirates.yml
  reginald:
    name: Reginald the Pirate
    monkey: george
  
  ### in monkeys.yml
  george:
    name: George the Monkey
    pirate: reginald
  </code></pre>
  
  <p>So following their lead, I have a User model that has_one :profile, a Profile model that belongs_to :user, and tried to set up fixtures per their example:</p>
  
  <pre><code>### in users.yml
  reginald:
    id: 1
    login: reginald
  
  ### in profiles.yml
  reginalds_profile:
    id: 1
    name: Reginald the Pirate
    user: reginald
  </code></pre>
  
  <p>(Note: since my association is one-way, the User fixture doesn't have a "profile: reginalds_profile" association--putting it in causes an error because the SQL table has no profile_id attribute.)</p>
  
  <p>The problem is, in my unit tests everything seems to load correctly, but users(:reginald).profile is always nil. What am I missing?</p>