From 74e665c3315c9a839cfbdf35f57fa3b72c6e6dfc Mon Sep 17 00:00:00 2001 From: Ryunosuke Sato Date: Thu, 21 Oct 2021 00:12:31 +0900 Subject: [PATCH] Require `rails_helper` instead of `spec_helper` on rspec 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 ``` --- .rspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rspec b/.rspec index dcd6274..f9f4ec5 100644 --- a/.rspec +++ b/.rspec @@ -1,4 +1,4 @@ --order rand --color --format progress ---require spec_helper +--require rails_helper