title: RSpec undefined local variable or method
body: <p>Having a weird error in spec/controllers/profiles_controller_spec.rb: undefined local variable or method 'profile'</p>
  
  <p>Pasted in relevant sections of the controller:</p>
  
  <pre><code>require 'rails_helper'
  require 'factory_girl'
  
  describe ProfilesController, :type =&gt; :controller do
    login_user #this is defined elsewhere, not an issue
    describe "PUT update" do
      before(:each) do
        @profile = FactoryGirl.create(:profile)
      end
      context "valid attributes" do
        it "located the requested @profile" do
          put :update, id: @profile, profile: FactoryGirl.attributes_for(:profile)
          assigns(:profile).should eq(@profile)
        end
      end
    end
  end
  </code></pre>