mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Added transactional fixtures that uses rollback to undo changes to fixtures instead of DELETE/INSERT -- it's much faster. See documentation under Fixtures #760 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@846 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -105,5 +105,34 @@ class FixturesTest < Test::Unit::TestCase
|
||||
def test_empty_csv_fixtures
|
||||
assert_not_nil Fixtures.new( Account.connection, "accounts", File.dirname(__FILE__) + "/fixtures/naked/csv/accounts")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
class FixturesWithoutInstantiationTest < Test::Unit::TestCase
|
||||
self.use_instantiated_fixtures = false
|
||||
fixtures :topics, :developers, :accounts
|
||||
|
||||
def test_without_complete_instantiation
|
||||
assert_nil @topics
|
||||
assert_nil @first
|
||||
end
|
||||
|
||||
def test_fixtures_from_root_yml_without_instantiation
|
||||
assert_nil @unknown
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
class TransactionalFixturesTest < Test::Unit::TestCase
|
||||
self.use_transactional_fixtures = true
|
||||
fixtures :topics
|
||||
|
||||
def test_destroy
|
||||
assert_not_nil @first
|
||||
@first.destroy
|
||||
end
|
||||
|
||||
def test_destroy_just_kidding
|
||||
assert_not_nil @first
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user