Skip to content

Commit

Permalink
Require rails_helper instead of spec_helper on rspec
Browse files Browse the repository at this point in the history
rails_helper is an actual entry point of specs.
This change allows developers to running single spec like the following:
```
$ bundle exec rspec spec/models/letter_opener_web/letter_spec.rb
```

Without this change, the following error will be occurred:
```
$ bundle exec rspec spec/models/letter_opener_web/letter_spec.rb

An error occurred while loading ./spec/models/letter_opener_web/letter_spec.rb.
Failure/Error:
  RSpec.describe LetterOpenerWeb::Letter do
    let(:location) { Pathname.new(__dir__).join('..', '..', 'tmp').cleanpath }

...

NameError:
  uninitialized constant LetterOpenerWeb::Letter
```
  • Loading branch information
tricknotes committed Oct 20, 2021
1 parent feea82d commit 74e665c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--order rand
--color
--format progress
--require spec_helper
--require rails_helper

0 comments on commit 74e665c

Please # to comment.