rspec / rspec-rails

RSpec for Rails 6+
https://rspec.info
MIT License
5.14k stars 1.03k forks source link

Fix generator for mailer #2735

Closed psantos10 closed 4 months ago

psantos10 commented 4 months ago

In Rails, I can generate a mailer in both ways:

bin/rails generate mailer User

or

bin/rails generate mailer UserMailer

Both ways will create a class UserMailer under the file app/mailers/user_mailer.rb and the test file test/mailers/user_mailer_test.rb (Minitest).

When using RSpec, if I call the command like: bin/rails generate mailer User, it will create the test file name like: spec/mailers/user_spec.rb instead of spec/mailers/user_mailer_spec.rb. The class though, is correct for the mailer test , but no for the preview file.

This PR try to solve this

pirj commented 4 months ago

The build will fail. Once the fix is merged, we’ll kick off ci

JonRowe commented 4 months ago

It will still need to be rebased

psantos10 commented 4 months ago

Hi @pirj

Sorry, not sure if I got you correctly. "Once the fix s. merged" - This fix needs to be done by me? What is failing?

Sorry, this is my first time here :)

pirj commented 4 months ago

Please rebase

psantos10 commented 4 months ago

Please rebase

Done. Thanks

JonRowe commented 4 months ago

Merged, thanks!