diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/associations_go_eager_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/conditions_scoping_test.rb | 1 | ||||
-rwxr-xr-x | activerecord/test/fixtures_test.rb | 81 | ||||
-rw-r--r-- | activerecord/test/pk_test.rb | 1 |
4 files changed, 3 insertions, 82 deletions
diff --git a/activerecord/test/associations_go_eager_test.rb b/activerecord/test/associations_go_eager_test.rb index 3dccc8e65a..c2e903fa2c 100644 --- a/activerecord/test/associations_go_eager_test.rb +++ b/activerecord/test/associations_go_eager_test.rb @@ -96,7 +96,7 @@ class EagerAssociationTest < Test::Unit::TestCase end def test_eager_with_has_many_and_limit - posts = Post.find(:all, :include => [ :author, :comments ], :limit => 2) + posts = Post.find(:all, :order => 'posts.id asc', :include => [ :author, :comments ], :limit => 2) assert_equal 2, posts.size assert_equal 3, posts.inject(0) { |sum, post| sum += post.comments.size } end diff --git a/activerecord/test/conditions_scoping_test.rb b/activerecord/test/conditions_scoping_test.rb index 4fc9aad64e..b945593b57 100644 --- a/activerecord/test/conditions_scoping_test.rb +++ b/activerecord/test/conditions_scoping_test.rb @@ -85,6 +85,7 @@ class HasAndBelongsToManyScopingTest< Test::Unit::TestCase assert_equal 0, @welcome.categories.find_all_by_type('SpecialCategory').size assert_equal 2, @welcome.categories.find_all_by_type('Category').size end + end diff --git a/activerecord/test/fixtures_test.rb b/activerecord/test/fixtures_test.rb index b5e49999f4..888d743078 100755 --- a/activerecord/test/fixtures_test.rb +++ b/activerecord/test/fixtures_test.rb @@ -86,7 +86,6 @@ class FixturesTest < Test::Unit::TestCase secondRow = ActiveRecord::Base.connection.select_one("SELECT * FROM prefix_topics_suffix WHERE author_name = 'Mary'") assert_nil(secondRow["author_email_address"]) ensure - Fixtures.all_loaded_fixtures.delete(topics) ActiveRecord::Base.connection.drop_table :prefix_topics_suffix rescue nil end @@ -290,83 +289,3 @@ class ForeignKeyFixturesTest < Test::Unit::TestCase assert true end end - - -class FixtureCleanup1Test < Test::Unit::TestCase - fixtures :topics - - def test_isolation - assert_equal 0, Developer.count - assert_equal 2, Topic.count - end -end - -class FixtureCleanup2Test < Test::Unit::TestCase - fixtures :developers - - def test_isolation - assert_equal 0, Topic.count - assert_equal 10, Developer.count - end -end - -class FixtureCleanup3Test < FixtureCleanup2Test - self.use_transactional_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 FixtureCleanup4Test < FixtureCleanup2Test - self.use_transactional_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 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 diff --git a/activerecord/test/pk_test.rb b/activerecord/test/pk_test.rb index 13adc7eb76..f9cfd6f293 100644 --- a/activerecord/test/pk_test.rb +++ b/activerecord/test/pk_test.rb @@ -24,6 +24,7 @@ class PrimaryKeysTest < Test::Unit::TestCase end def test_customized_primary_key_auto_assigns_on_save + Keyboard.delete_all keyboard = Keyboard.new(:name => 'HHKB') assert_nothing_raised { keyboard.save! } assert_equal keyboard.id, Keyboard.find_by_name('HHKB').id |