Having a weird error in spec/controllers/profiles_controller_spec.rb: undefined local variable or method 'profile'
Pasted in relevant sections of the controller:
require 'rails_helper'
require 'factory_girl'
describe ProfilesController, :type => :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
profilebare word in the spec you posted above, so it's probably coming from something you are calling from this spec.