diff options
author | Prem Sichanugrist <s@sikachu.com> | 2010-06-24 22:05:27 +0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-24 20:17:59 +0200 |
commit | 67ee6c38b9b112eabe37d5869c23210b9ebf453c (patch) | |
tree | 37e73557b64016a1694ffa6a839bd932931bf2bf /railties/lib/rails/generators/test_unit | |
parent | 7a7c608a26f03abb1245ff83d4e25040ad09cb44 (diff) | |
download | rails-67ee6c38b9b112eabe37d5869c23210b9ebf453c.tar.gz rails-67ee6c38b9b112eabe37d5869c23210b9ebf453c.tar.bz2 rails-67ee6c38b9b112eabe37d5869c23210b9ebf453c.zip |
Remove the --singeleton option from scaffold generator.
It turned out to be that scaffold for singeleton resource will always depend on another model, and it's not possible at the moment to make the application tests pass after generate the singeleton scafold. So, it would be better to remove it for now and probably provide another generator, such as singeleton_scaffold, in which also require the depended model name.
[#4863 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties/lib/rails/generators/test_unit')
-rw-r--r-- | railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb | 2 |
2 files changed, 0 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb index c0315c7fe6..f7e907a017 100644 --- a/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +++ b/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb @@ -6,7 +6,6 @@ module TestUnit class ScaffoldGenerator < Base include Rails::Generators::ResourceHelpers - 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/rails/generators/test_unit/scaffold/templates/functional_test.rb b/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb index 957ebaa522..f23e495450 100644 --- a/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb +++ b/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb @@ -5,13 +5,11 @@ class <%= controller_class_name %>ControllerTest < ActionController::TestCase @<%= singular_table_name %> = <%= table_name %>(:one) end -<% 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 |