title: factory girl nested factory
body: <p>I have an account model that belongs_to a role model.</p>
  
  <pre><code>factory :role do
    name "student"
  end
  
  factory :account do
    user
    role
  end
  </code></pre>
  
  <p>The first factory creates a role named "student".  The second factory creates an account that is associated to the student role that was created in the previous factory.  It also is associated with a user...which is not important for this question.</p>
  
  <p>I have many roles to be tested (admin, student, assistant)...  I dont want to specify 'student' in the role factory...thats too static.  How do I specify what role to create at the time the account factory is created?  Like:</p>
  
  <pre><code>  factory :account do
      user
      role_id { factory :role { name: "admin"} }
    end
  </code></pre>
  
  <p>What is the best way to accomplish this?</p>