title: rspec and undefined method on model
body: <p>I'm trying to follow the railscasts on Integration Testing and am testing a password reset url. I am having a problem with NoMethodError and am not sure what is going on.</p>
  
  <p>I have a user model that has a forgot_password value which is just a hash that will be emailed out.</p>
  
  <p>This seems to be working  </p>
  
  <pre><code>ruby-1.9.2-p290 :001 &gt; u=User.find(1)
  ...
  ruby-1.9.2-p290 :002 &gt; u.forgot_password
   =&gt; "1280aceaf23f185a2d09a57b5534e7e3"
  </code></pre>
  
  <p>but I get the following error:</p>
  
  <pre><code>1) PasswordResets emails user when requesting password reset
     Failure/Error: click_button "jt"
     NoMethodError:
       undefined method `forgot_password=' for #&lt;User:0x007ff916b03da0&gt;
     # /Users/jt/rails-1/app/controllers/users_controller.rb:61:in `forgot_password_confirmation'
     # (eval):2:in `click_button'
  </code></pre>
  
  <p>and here is the spec:</p>
  
  <p>require 'spec_helper'</p>
  
  <pre><code>describe "PasswordResets" do
    it "emails user when requesting password reset" do
      user=Factory(:user)
      visit log_in_path
      click_link "password"
      fill_in "email", :with =&gt; user.email
      click_button "jt"
    end
  end
  </code></pre>
  
  <p>What does the the NoMethodError tell me? It looks as if from rails c, the forgot_password value exists. What am I missing?</p>
  
  <p>thx</p>