1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Move fixtures settings from AR::TestCase to railties test_help

This commit is contained in:
Jeremy Kemper 2008-11-12 11:33:09 -08:00
parent 4e9abdd7f1
commit 9a88ab64bb
2 changed files with 16 additions and 13 deletions

View file

@ -1,15 +1,7 @@
require "active_support/test_case"
module ActiveRecord
module ActiveRecord
class TestCase < ActiveSupport::TestCase #:nodoc:
self.fixture_path = FIXTURES_ROOT
self.use_instantiated_fixtures = false
self.use_transactional_fixtures = true
def create_fixtures(*table_names, &block)
Fixtures.create_fixtures(FIXTURES_ROOT, table_names, {}, &block)
end
def assert_date_from_db(expected, actual, message = nil)
# SQL Server doesn't have a separate column type just for dates,
# so the time is in the string and incorrectly formatted

View file

@ -11,11 +11,22 @@ require 'action_controller/test_case'
require 'action_controller/integration'
require 'action_mailer/test_case' if defined?(ActionMailer)
Test::Unit::TestCase.fixture_path = RAILS_ROOT + "/test/fixtures/"
ActionController::IntegrationTest.fixture_path = Test::Unit::TestCase.fixture_path
if defined?(ActiveRecord)
require 'active_record/test_case'
require 'active_record/fixtures'
def create_fixtures(*table_names)
Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names)
class ActiveSupport::TestCase
include ActiveRecord::TestFixtures
self.fixture_path = "#{RAILS_ROOT}/test/fixtures/"
self.use_instantiated_fixtures = false
self.use_transactional_fixtures = true
end
ActionController::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
def create_fixtures(*table_names, &block)
Fixtures.create_fixtures(ActiveSupport::TestCase.fixture_path, table_names, {}, &block)
end
end
begin