diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-10-24 16:45:33 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-10-24 16:45:33 +0000 |
commit | f57ba4cc5237b408e23715ab6c7d700bd8e125b0 (patch) | |
tree | 0ff766a1adef059bfc417c93441d1a134a1d9735 /activerecord/test/fixtures_test.rb | |
parent | 0e4c5b0288c3fab5ec8bdc4d7448be2b72e55e58 (diff) | |
download | rails-f57ba4cc5237b408e23715ab6c7d700bd8e125b0.tar.gz rails-f57ba4cc5237b408e23715ab6c7d700bd8e125b0.tar.bz2 rails-f57ba4cc5237b408e23715ab6c7d700bd8e125b0.zip |
r2727@asus: jeremy | 2005-10-24 14:14:36 -0700
Fallback to @loaded_fixtures = {}. Use Logger#silence. Test fixture isolation with use_instantiated_fixtures and with no fixtures declaration.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures_test.rb')
-rwxr-xr-x | activerecord/test/fixtures_test.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/activerecord/test/fixtures_test.rb b/activerecord/test/fixtures_test.rb index ef931ea873..b5e49999f4 100755 --- a/activerecord/test/fixtures_test.rb +++ b/activerecord/test/fixtures_test.rb @@ -329,3 +329,44 @@ class FixtureCleanup4Test < FixtureCleanup2Test assert_equal %w(developers), fixture_table_names end end + +class FixtureCleanup5Test < FixtureCleanup3Test + self.use_instantiated_fixtures = false + + def test_dirty_fixture_table_names + assert_equal %w(developers), dirty_fixture_table_names + assert_equal %w(developers), loaded_fixture_table_names + assert_equal %w(developers), fixture_table_names + end +end + +class FixtureCleanup6Test < FixtureCleanup4Test + self.use_instantiated_fixtures = true + + def test_dirty_fixture_table_names + assert_equal [], dirty_fixture_table_names + assert_equal %w(developers), loaded_fixture_table_names + assert_equal %w(developers), fixture_table_names + end +end + +class FixtureCleanup7Test < Test::Unit::TestCase + self.use_transactional_fixtures = false + self.use_instantiated_fixtures = true + + def test_dirty_fixture_table_names + assert_equal [], dirty_fixture_table_names + assert_equal [], loaded_fixture_table_names + assert_equal [], fixture_table_names + end + + def test_isolation + assert_equal 0, Topic.count + assert_equal 0, Developer.count + end +end + +class FixtureCleanup8Test < FixtureCleanup7Test + self.use_transactional_fixtures = true + self.use_instantiated_fixtures = true +end |