From 56ef96081b49e7fbff9b7a90dce0f0bc977bac94 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 7 Sep 2011 04:03:41 +0000 Subject: [PATCH] Rails3: scm: git: fix error of test_db_consistent_ordering_before_1_2 at unit model test On Rails 3.1, ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection error raises. For more details, see r7062. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7072 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/repository_git_test.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/unit/repository_git_test.rb b/test/unit/repository_git_test.rb index a6a743486..e8e1ac03d 100644 --- a/test/unit/repository_git_test.rb +++ b/test/unit/repository_git_test.rb @@ -183,16 +183,17 @@ class RepositoryGitTest < ActiveSupport::TestCase def test_db_consistent_ordering_before_1_2 assert_nil @repository.extra_info + assert_equal 0, @repository.changesets.count @repository.fetch_changesets - @repository.reload - assert_equal 21, @repository.changesets.count + @project.reload + assert_equal NUM_REV, @repository.changesets.count assert_not_nil @repository.extra_info @repository.write_attribute(:extra_info, nil) @repository.save assert_nil @repository.extra_info - assert_equal 21, @repository.changesets.count + assert_equal NUM_REV, @repository.changesets.count @repository.fetch_changesets - @repository.reload + @project.reload assert_equal 0, @repository.extra_info["db_consistent"]["ordering"] del_revs = [ @@ -215,13 +216,13 @@ class RepositoryGitTest < ActiveSupport::TestCase "4a07fe31bffcf2888791f3e6cbc9c4545cefe3e8" @repository.merge_extra_info(h) @repository.save - @repository.reload + @project.reload extra_info_db_1 = @repository.extra_info["branches"] assert_equal "4a07fe31bffcf2888791f3e6cbc9c4545cefe3e8", extra_info_db_1["master"]["last_scmid"] @repository.fetch_changesets - assert_equal 21, @repository.changesets.count + assert_equal NUM_REV, @repository.changesets.count assert_equal 0, @repository.extra_info["db_consistent"]["ordering"] end