Class: Rspec::Generators::ScaffoldGenerator
- Inherits:
-
Base
- Object
- Rails::Generators::NamedBase
- Base
- Rspec::Generators::ScaffoldGenerator
- Includes:
- Rails::Generators::ResourceHelpers
- Defined in:
- lib/generators/rspec/scaffold/scaffold_generator.rb
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#generate_controller_spec ⇒ Object
22 23 24 25 26 27 |
# File 'lib/generators/rspec/scaffold/scaffold_generator.rb', line 22 def generate_controller_spec return unless [:controller_specs] template 'controller_spec.rb', File.join('spec/controllers', controller_class_path, "#{controller_file_name}_controller_spec.rb") end |
#generate_routing_spec ⇒ Object
43 44 45 46 47 48 |
# File 'lib/generators/rspec/scaffold/scaffold_generator.rb', line 43 def generate_routing_spec return unless [:routing_specs] template 'routing_spec.rb', File.join('spec/routing', controller_class_path, "#{controller_file_name}_routing_spec.rb") end |
#generate_view_specs ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/generators/rspec/scaffold/scaffold_generator.rb', line 29 def generate_view_specs return unless [:view_specs] copy_view :edit copy_view :index unless [:singleton] copy_view :new copy_view :show end |