Skip to content

Commit 7d4bc0d

Browse files
Delegate test_helper configuration to test_unit generator
1 parent 093bde4 commit 7d4bc0d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ def add_migrations
5656
generate "migration", "CreateSessions", "user:references ip_address:string user_agent:string", "--force"
5757
end
5858

59-
def configure_test_helper
60-
inject_into_file "test/test_helper.rb", "require_relative \"test_helpers/session_test_helper\"\n", after: "require \"rails/test_help\"\n"
61-
inject_into_class "test/test_helper.rb", "TestCase", " include SessionTestHelper\n"
62-
end
63-
6459
hook_for :test_framework
6560
end
6661
end

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ def create_mailer_preview_files
2222
def create_test_helper_files
2323
template "test/test_helpers/session_test_helper.rb"
2424
end
25+
26+
def configure_test_helper
27+
inject_into_file "test/test_helper.rb", "require_relative \"test_helpers/session_test_helper\"\n", after: "require \"rails/test_help\"\n"
28+
inject_into_class "test/test_helper.rb", "TestCase", " include SessionTestHelper\n"
29+
end
2530
end
2631
end
2732
end

0 commit comments

Comments
 (0)