Skip to content

Commit 093bde4

Browse files
Delegate mailer preview file creation to test_unit generator
1 parent b21423a commit 093bde4

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

railties/lib/rails/generators/rails/authentication/authentication_generator.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ def create_authentication_files
3030

3131
template "app/views/passwords_mailer/reset.html.erb"
3232
template "app/views/passwords_mailer/reset.text.erb"
33-
34-
template "test/mailers/previews/passwords_mailer_preview.rb"
3533
end
3634
end
3735

railties/lib/rails/generators/test_unit/authentication/authentication_generator.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ def create_controller_test_files
1515
template "test/controllers/passwords_controller_test.rb"
1616
end
1717

18+
def create_mailer_preview_files
19+
template "test/mailers/previews/passwords_mailer_preview.rb" if defined?(ActionMailer::Railtie)
20+
end
21+
1822
def create_test_helper_files
1923
template "test/test_helpers/session_test_helper.rb"
2024
end
File renamed without changes.

0 commit comments

Comments
 (0)