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
21 22 23 24 25 26 |
# File 'lib/generators/rspec/scaffold/scaffold_generator.rb', line 21 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
42 43 44 45 46 47 |
# File 'lib/generators/rspec/scaffold/scaffold_generator.rb', line 42 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
28 29 30 31 32 33 34 35 |
# File 'lib/generators/rspec/scaffold/scaffold_generator.rb', line 28 def generate_view_specs return unless [:view_specs] copy_view :edit copy_view :index unless [:singleton] copy_view :new copy_view :show end |