Here is my test. The error I am getting is ActiveRecord::RecordNotFound: Couldn't find MedicalStudentProfile with 'id'=1001. Am I using build_stubbed correctly?
RSpec Test
RSpec.describe MedicalStudentProfilesController, type: :controller do
let!(:profile){build_stubbed(:medical_student_profile)}
let!(:user){build_stubbed(:user)}
describe 'GET show' do
it 'should show the requested object' do
sign_in user
get :show, id: profile.id
expect(assigns(:profile)).to eq profile
end
end
end
Controller
def show
@profile = MedicalStudentProfile.find params[:id]
end