Class: TestUnit::Generators::AuthenticationGenerator
Overview
Instance Method Summary
collapse
base_root, class_option, default_source_root, desc, exit_on_failure?, hide!, hook_for, inherited, namespace, remove_hook_for, source_root
#add_source, #environment, #gem, #gem_group, #generate, #git, #github, #initialize, #initializer, #lib, #rails_command, #rake, #rakefile, #readme, #route, #vendor
Instance Method Details
26
27
28
|
# File 'lib/rails/generators/test_unit/authentication/authentication_generator.rb', line 26
def configure_test_helper
inject_into_file "test/test_helper.rb", "require_relative \"test_helpers/session_test_helper\"\n", after: "require \"rails/test_help\"\n"
end
|
#create_controller_test_files ⇒ Object
13
14
15
16
|
# File 'lib/rails/generators/test_unit/authentication/authentication_generator.rb', line 13
def create_controller_test_files
template "test/controllers/sessions_controller_test.rb"
template "test/controllers/passwords_controller_test.rb"
end
|
#create_mailer_preview_files ⇒ Object
18
19
20
|
# File 'lib/rails/generators/test_unit/authentication/authentication_generator.rb', line 18
def create_mailer_preview_files
template "test/mailers/previews/passwords_mailer_preview.rb" if defined?(ActionMailer::Railtie)
end
|
#create_test_helper_files ⇒ Object
22
23
24
|
# File 'lib/rails/generators/test_unit/authentication/authentication_generator.rb', line 22
def create_test_helper_files
template "test/test_helpers/session_test_helper.rb"
end
|
#create_user_test_files ⇒ Object
8
9
10
11
|
# File 'lib/rails/generators/test_unit/authentication/authentication_generator.rb', line 8
def create_user_test_files
template "test/fixtures/users.yml"
template "test/models/user_test.rb"
end
|