From a654ef2ee11142f3764fb312aa84a979adb890d9 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Fri, 9 Apr 2010 01:06:41 -0300 Subject: Don't include fixtures if --skip-activerecord is given --- railties/lib/rails/generators/rails/app/app_generator.rb | 12 +++++++++++- .../rails/generators/rails/app/templates/test/test_helper.rb | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'railties/lib/rails') 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 -- cgit v1.2.3