diff options
Diffstat (limited to 'railties/lib/generators/test_unit/scaffold')
-rw-r--r-- | railties/lib/generators/test_unit/scaffold/scaffold_generator.rb | 2 | ||||
-rw-r--r-- | railties/lib/generators/test_unit/scaffold/templates/functional_test.rb | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/railties/lib/generators/test_unit/scaffold/scaffold_generator.rb b/railties/lib/generators/test_unit/scaffold/scaffold_generator.rb index 7c73a23267..0f6255383e 100644 --- a/railties/lib/generators/test_unit/scaffold/scaffold_generator.rb +++ b/railties/lib/generators/test_unit/scaffold/scaffold_generator.rb @@ -4,6 +4,8 @@ module TestUnit module Generators class ScaffoldGenerator < Base include Rails::Generators::ControllerNamedBase + + class_option :singleton, :type => :boolean, :desc => "Supply to create a singleton controller" check_class_collision :suffix => "ControllerTest" def create_test_files diff --git a/railties/lib/generators/test_unit/scaffold/templates/functional_test.rb b/railties/lib/generators/test_unit/scaffold/templates/functional_test.rb index cd2fc578bf..e4bf4035da 100644 --- a/railties/lib/generators/test_unit/scaffold/templates/functional_test.rb +++ b/railties/lib/generators/test_unit/scaffold/templates/functional_test.rb @@ -1,11 +1,13 @@ require 'test_helper' class <%= controller_class_name %>ControllerTest < ActionController::TestCase +<% unless options[:singleton] -%> test "should get index" do get :index assert_response :success assert_not_nil assigns(:<%= table_name %>) end +<% end -%> test "should get new" do get :new |