title: Discover errors in Invalid Record factory girl
body: <p>I have a user factory like this:</p>
  
  <pre><code>FactoryGirl.define do
    factory :user do
      email "email@x.com"
      password "123456789"
    end
  end
  </code></pre>
  
  <p>I am trying to create a spec for the user:</p>
  
  <pre><code>describe User do
    it "should create a user with password" do
      user = FactoryGirl.create(:user, password: "secret")
      user.password.should == "secret"
    end   
  end
  </code></pre>
  
  <p>When I run the test, I get this message:</p>
  
  <pre><code>  1) User should create a user with password
       Failure/Error: user = FactoryGirl.create(:user, password: "secret")
       ActiveRecord::RecordInvalid:
         is invalid
       # ./spec/models/user_spec.rb:3:in `block (2 levels) in &lt;top (required)&gt;'
       # -e:1:in `&lt;main&gt;'
  </code></pre>
  
  <p>The problem is: how to discover what are the fields in the model that are invalid? In other words, how to print the error messages inside the model?</p>