Skip to content

Commit

Permalink
Generate controller and view specs with the controller generarator
Browse files Browse the repository at this point in the history
- Closes rspec#205.
  • Loading branch information
dchelimsky committed Sep 16, 2010
1 parent c1ff570 commit 4321f81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/generators/rspec/controller/controller_generator.rb
Expand Up @@ -10,15 +10,15 @@ class ControllerGenerator < Base
class_option :view_specs, :type => :boolean, :default => true

def create_controller_files
return unless options[:controllers]
return unless options[:controller_specs]

template 'controller_spec.rb',
File.join('spec/controllers', class_path, "#{file_name}_controller_spec.rb")
end

def create_view_files
return if actions.empty?
return unless options[:views]
return unless options[:view_specs]

empty_directory File.join("spec", "views", file_path)

Expand Down

0 comments on commit 4321f81

Please sign in to comment.