]> source.dussan.org Git - redmine.git/commitdiff
Rails3: scm: cvs: fix error of test_fetch_changesets_incremental at unit model test
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 26 Feb 2012 14:09:21 +0000 (14:09 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 26 Feb 2012 14:09:21 +0000 (14:09 +0000)
On Rails 3.1, ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection error raises.
For more details, see r7062.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9016 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/repository_cvs_test.rb

index a616a2c099862e9cadf99f7a14ece20ea5348e41..21cb091603a3224114d4be667f1cb2befb06e177 100644 (file)
@@ -112,11 +112,14 @@ class RepositoryCvsTest < ActiveSupport::TestCase
     def test_fetch_changesets_incremental
       assert_equal 0, @repository.changesets.count
       @repository.fetch_changesets
+      @project.reload
+      assert_equal CHANGESETS_NUM, @repository.changesets.count
+
       # Remove changesets with revision > 3
       @repository.changesets.find(:all).each {|c| c.destroy if c.revision.to_i > 3}
-      @repository.reload
+      @project.reload
       assert_equal 3, @repository.changesets.count
-      assert_equal %w|3 2 1|, @repository.changesets.collect(&:revision)
+      assert_equal %w|3 2 1|, @repository.changesets.all.collect(&:revision)
 
       rev3_commit = @repository.changesets.find(:first, :order => 'committed_on DESC')
       assert_equal '3', rev3_commit.revision
@@ -128,10 +131,9 @@ class RepositoryCvsTest < ActiveSupport::TestCase
       assert_equal rev3_committed_on, latest_rev.committed_on
 
       @repository.fetch_changesets
-      @repository.reload
+      @project.reload
       assert_equal CHANGESETS_NUM, @repository.changesets.count
-
-      assert_equal %w|7 6 5 4 3 2 1|, @repository.changesets.collect(&:revision)
+      assert_equal %w|7 6 5 4 3 2 1|, @repository.changesets.all.collect(&:revision)
       rev5_commit = @repository.changesets.find_by_revision('5')
       assert_equal 'HEAD-20071213-163001', rev5_commit.scmid
        # 2007-12-14 01:30:01 +0900