I have an error of the following form and I am unable to point out the error.
Without more information and background on what you're doing it's hard to say. A google search turns up a ton of SO articles on this, some related to testing, some not. Can you give more detail?
Following is the whole error:
An error occurred while loading ./spec/models/completed_lesson_spec.rb.
Failure/Error:
RSpec.describe Completed_lesson, type: :model do
it "has a user_id" do
completed_lesson = Completed_lesson.create!(user_id: 1)
second_completed_lesson = Completed_lesson.create!(user_id: 2)
expect(second_completed_lesson.user_id).to eq(2)
end
end
LoadError:
Unable to autoload constant Completed_lesson, expected C:/Sites/SM-rails/app/models/completed_lesson.rb to define it
# ./spec/models/completed_lesson_spec.rb:3:in `<top (required)>'
No examples found.
An error occurred while loading ./spec/models/completed_lesson_spec.rb.
Failure/Error:
RSpec.describe Completed_lesson, type: :model do
it "has a user_id" do
completed_lesson = Completed_lesson.create!(user_id: 1)
second_completed_lesson = Completed_lesson.create!(user_id: 2)
expect(second_completed_lesson.user_id).to eq(2)
end
end
LoadError:
Unable to autoload constant Completed_lesson, expected C:/Sites/SM-rails/app/models/completed_lesson.rb to define it
# ./spec/models/completed_lesson_spec.rb:3:in `<top (required)>'
No examples found.
Change your class name from `Completed_lesson` to
CompletedLesson
Its a naming convention in Rails.