learn-co-students / rails-activerecord-models-and-rails-readme-v-000

Other
0 stars 413 forks source link

LoadError: cannot load such file -- spec_helper #103

Open atxrenegade opened 6 years ago

atxrenegade commented 6 years ago

LESSON STATES: "Let's create a new file: spec/models/post_spec.rb. In that file, place the following code:

require 'rails_helper'

describe Post do

end"

Results in: "An error occurred while loading ./spec/models/post_spec.rb. Failure/Error: require 'rails_helper'

LoadError: cannot load such file -- rails_helper"

Tests will not even load until the following line is removed or commented out:

require 'rails_helper'

Following the lab as directed does not result in tests passing.

mddilley commented 5 years ago

I just encountered this same error, and the lesson states:

# Finally, we created the initial RSpec config:

rails g rspec:install

The code in this repository does not reflect the changes made by this command and needs to be amended. The lesson could also be amended to instruct the student to run this command in the console prior to the next step.

Running this command in the console creates the spec folder and rails_helper.rb within it (along with some other files). Then, the lab can be completed as intended.

meg-gutshall commented 5 years ago

I second @mddilley's comment. Could someone please address this 10-week-old open issue??

guysbryant commented 5 years ago

I have created a pull request which fixes this issue if somebody would like to approve it.

Sdcrouse commented 5 years ago

I think this issue has been fixed. When I opened this lab, the spec folder contained these files: rails_helper.rb and spec_helper.rb. I was able to run the tests and complete the lab without any trouble. That said, there were quite a few deprecation warnings (I'm using Rails version 5.0.7.2).

meg-gutshall commented 5 years ago

Yes @Sdcrouse, it looks like @drakeltheryuujin addressed this in July with commit e6608aea1c72fa5c3eef912a43d02f7aa49bcef2 and may have just forgotten to close out this issue. Thanks for following up on this though! YOU --> 💯 👍

Sdcrouse commented 5 years ago

You're welcome, @meg-gutshall ! 😁