diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-12 11:33:09 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-12 11:33:09 -0800 |
commit | b17eb65d00242ae10ac9ed97ef22d88fdd710533 (patch) | |
tree | ed26cc981c610ba49a71c464bc8593b6aae88ba0 /railties | |
parent | a0e7b99443cccbd01b0eefcd53b0e20878f54deb (diff) | |
download | rails-b17eb65d00242ae10ac9ed97ef22d88fdd710533.tar.gz rails-b17eb65d00242ae10ac9ed97ef22d88fdd710533.tar.bz2 rails-b17eb65d00242ae10ac9ed97ef22d88fdd710533.zip |
Move fixtures settings from AR::TestCase to railties test_help
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/test_help.rb | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/railties/lib/test_help.rb b/railties/lib/test_help.rb index 442ce3fadc..a7be514cf0 100644 --- a/railties/lib/test_help.rb +++ b/railties/lib/test_help.rb @@ -7,16 +7,22 @@ silence_warnings { RAILS_ENV = "test" } require 'action_controller/integration' require 'action_mailer/test_case' if defined?(ActionMailer) -require 'active_record/fixtures' -class ActiveSupport::TestCase - include ActiveRecord::TestFixtures -end +if defined?(ActiveRecord) + require 'active_record/test_case' + require 'active_record/fixtures' + + class ActiveSupport::TestCase + include ActiveRecord::TestFixtures + self.fixture_path = "#{RAILS_ROOT}/test/fixtures/" + self.use_instantiated_fixtures = false + self.use_transactional_fixtures = true + end -ActiveSupport::TestCase.fixture_path = "#{RAILS_ROOT}/test/fixtures/" -ActionController::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path + ActionController::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path -def create_fixtures(*table_names) - Fixtures.create_fixtures(ActiveSupport::TestCase.fixture_path, table_names) + def create_fixtures(*table_names, &block) + Fixtures.create_fixtures(ActiveSupport::TestCase.fixture_path, table_names, {}, &block) + end end begin |