diff options
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 12 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/test/test_helper.rb | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index df6e98f38d..6d085f0935 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -157,7 +157,17 @@ module Rails::Generators def create_test_files return if options[:skip_testunit] - directory "test" + empty_directory "test" + + inside "test" do + template "test_helper.rb" + + directory "fixtures" + directory "functional" + directory "integration" + directory "performance" + directory "unit" + end end def create_tmp_files diff --git a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb index 8bf1192ffe..c5e9cc2fc3 100644 --- a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb +++ b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb @@ -7,7 +7,9 @@ class ActiveSupport::TestCase # # Note: You'll currently still have to declare fixtures explicitly in integration tests # -- they do not yet inherit this setting +<% unless options[:skip_activerecord] -%> fixtures :all +<% end -%> # Add more helper methods to be used by all tests here... end |