fgrehm / letter_opener_web

A web interface for browsing Ruby on Rails sent emails
MIT License
718 stars 112 forks source link

Require `rails_helper` instead of `spec_helper` on rspec #115

Closed tricknotes closed 3 years ago

tricknotes commented 3 years ago

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
fgrehm commented 3 years ago

Thank you!