title: No method error - save from rubystutorial.org
body: <p>I've been following along Hartl's book at rubystutorial.org and stuck on this error</p>
  
  <p>When I run rspec tests it tells me that the method (save) does not exist for user</p>
  
  <p>Here's my code and test. I can't find what's wrong with it and why the method doesn't exist within @user</p>
  
  <p>user_spec.rb</p>
  
  <pre><code>require 'spec_helper'
  
  describe User do
  
    before do
      @user = User.new(name: "Example User", email: "user@example.com") 
    end
  
    subject { @user }
  
    it { should respond_to(:name) }
    it { should respond_to(:email) }
  
    it { should be_valid }
  
    describe "when name is not present" do
      before { @user.name = " " }
      it { should_not be_valid }
    end
  
    describe "when email is not present" do
      before { @user.email = " " }
      it { should_not be_valid }
    end
  
    describe "when name is too long" do
      before { @user.name = "a" * 51 }
      it { should_not be_valid } 
    end
  
    describe "when email format is invalid" do
      it "shoud be invalid" do 
        addresses = %w[user@foo,com user_at_foo.org example.user@foo. foo@bar_baz.com foo@bar+baz.com]
        addresses.each do |invalid_address|
          @user.email = invalid_address
          expect(@user).not_to be_valid
        end
      end
    end
  
    describe "when email format is valid" do 
      it "should be valid" do 
        addresses = %w[user@foo.COM A_US-ER@f.b.org frst.lst@foo.jp a+b@baz.cn]
        addresses.each do |valid_address|
          @user.email = valid_address
          expect(@user).to be_valid
        end
      end
    end
  
    describe "when email address is already taken" do 
      before do
        user_with_same_email = @user.dup
        user_with_same_email = @user.email.upcase
        user_with_same_email.save
      end
  
      it { should_not be_valid }
    end
  
  end
  </code></pre>
  
  <p>And my user.rb</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
      before_save { self.email = email.downcase }
      validates(:name, presence: true, length: { maximum: 50 } )
      VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
      validates(:email, presence: true, format: { with: VALID_EMAIL_REGEX },
                        uniqueness: { case_sensitive: false } )
  end
  </code></pre>
  
  <p>Exact error is</p>
  
  <pre><code>Failures:
  
  1) User when email address is already taken 
  
   Failure/Error: user_with_same_email.save
   NoMethodError:
     undefined method `save' for "USER@EXAMPLE.COM":String
   # ./spec/models/user_spec.rb:55:in `block (3 levels) in &lt;top (required)&gt;'
  
  Finished in 0.411 seconds
  24 examples, 1 failure
  
  Failed examples:
  
  rspec ./spec/models/user_spec.rb:58 # User when email address is already take
  </code></pre>