Class: Minitest::Generators::ScaffoldGenerator

Inherits:
Base
  • Object
show all
Includes:
Rails::Generators::ResourceHelpers
Defined in:
lib/generators/minitest/scaffold/scaffold_generator.rb

Instance Method Summary collapse

Methods inherited from Base

default_source_root

Instance Method Details

#create_test_filesObject


13
14
15
16
17
18
19
20
21
# File 'lib/generators/minitest/scaffold/scaffold_generator.rb', line 13

def create_test_files
  if options[:spec]
    template_file = "controller_spec.rb"
  else
    template_file = "controller_test.rb"
  end
  template template_file,
           File.join("test/controllers", controller_class_path, "#{controller_file_name}_controller_test.rb")
end