Class: Rspec::Generators::ControllerGenerator Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Base ,
Rails::Generators::NamedBase
|
|
Instance Chain:
self,
Base ,
::RSpec::Rails::FeatureCheck ,
Rails::Generators::NamedBase
|
|
Inherits: |
Rspec::Generators::Base
|
Defined in: | rspec-rails/lib/generators/rspec/controller/controller_generator.rb |
Class Method Summary
Base
- Inherited
.configuration | Load configuration from |
.source_root |
Instance Method Summary
- #generate_controller_spec Internal use only
- #generate_request_spec Internal use only
- #generate_routing_spec Internal use only
- #generate_view_specs Internal use only
Base
- Inherited
::RSpec::Rails::FeatureCheck
- Included
Instance Method Details
#generate_controller_spec
[ GitHub ]# File 'rspec-rails/lib/generators/rspec/controller/controller_generator.rb', line 22
def generate_controller_spec return unless [:controller_specs] template 'controller_spec.rb', target_path('controllers', class_path, "#{file_name}_controller_spec.rb") end
#generate_request_spec
[ GitHub ]# File 'rspec-rails/lib/generators/rspec/controller/controller_generator.rb', line 15
def generate_request_spec return unless [:request_specs] template 'request_spec.rb', target_path('requests', class_path, "#{file_name}_spec.rb") end
#generate_routing_spec
[ GitHub ]# File 'rspec-rails/lib/generators/rspec/controller/controller_generator.rb', line 42
def generate_routing_spec return if actions.empty? return unless [:routing_specs] template 'routing_spec.rb', target_path('routing', class_path, "#{file_name}_routing_spec.rb") end
#generate_view_specs
[ GitHub ]# File 'rspec-rails/lib/generators/rspec/controller/controller_generator.rb', line 29
def generate_view_specs return if actions.empty? && behavior == :invoke return unless [:view_specs] && [:template_engine] empty_directory File.join("spec", "views", file_path) actions.each do |action| @action = action template 'view_spec.rb', target_path('views', file_path, "#{@action}.html.#{ [:template_engine]}_spec.rb") end end