title: how to test password length on update of password
body: <p>When a new user is created they are given a password.</p>
  
  <p>I want to test the case when the user updates or changes their password.  </p>
  
  <p>User.rb</p>
  
  <pre><code> validates :password, :on =&gt; :create,
                  :presence =&gt; true,
                  :confirmation =&gt; true,
                  :length =&gt; {:within =&gt; 6..12}
  
  before_validation :make_password, :on =&gt; :create
  </code></pre>
  
  <p>In spec/models/user_spec.rb  I have the following:</p>
  
  <p>describe "password validations" do
      before(:each) do
        @user = Factory(:user)
      end</p>
  
  <pre><code>it "should reject passwords that are too long" do
    too_long_password = "a" * 13
    @user.update_attributes(@attr.merge(:password =&gt; too_long_password, :password_confirmation =&gt; too_long_password)).should_not be_valid
  end
  </code></pre>
  
  <p>end</p>
  
  <p>Does not work.
  Now how do I test for the update? 
  Any ideas appreciated.</p>