Class: Rspec::Generators::LeoscaGenerator

Inherits:
ScaffoldGenerator
  • Object
show all
Includes:
Leonardo::Leosca, Leonardo::Nested, Leonardo::Nested::Test
Defined in:
lib/generators/rspec/leosca/leosca_generator.rb

Instance Method Summary collapse

Instance Method Details

#generate_controller_specObject

Override



19
20
21
22
23
24
# File 'lib/generators/rspec/leosca/leosca_generator.rb', line 19

def generate_controller_spec
  return unless options[:controller_specs]

  template 'controller_spec.rb',
           File.join('spec/controllers', base_namespaces, controller_class_path, "#{controller_file_name}_controller_spec.rb")
end

#generate_routing_specObject

Override



27
28
29
30
31
32
# File 'lib/generators/rspec/leosca/leosca_generator.rb', line 27

def generate_routing_spec
  return unless options[:routing_specs]

  template 'routing_spec.rb',
    File.join('spec/routing', base_namespaces, controller_class_path, "#{controller_file_name}_routing_spec.rb")
end