scm: git: add more tests in fetch changesets incremental unit model test (#5357).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4986 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-03-02 05:12:39 +00:00
parent d245102e97
commit b59becdfbc
1 changed files with 12 additions and 2 deletions

View File

@ -61,8 +61,18 @@ class RepositoryGitTest < ActiveSupport::TestCase
# Remove the 3 latest changesets # Remove the 3 latest changesets
@repository.changesets.find(:all, :order => 'committed_on DESC', :limit => 3).each(&:destroy) @repository.changesets.find(:all, :order => 'committed_on DESC', :limit => 3).each(&:destroy)
@repository.reload @repository.reload
assert_equal 13, @repository.changesets.count cs1 = @repository.changesets
assert_equal 13, cs1.count
rev_a_commit = @repository.changesets.find(:first, :order => 'committed_on DESC')
assert_equal '4f26664364207fa8b1af9f8722647ab2d4ac5d43', rev_a_commit.revision
# Mon Jul 5 22:34:26 2010 +0200
rev_a_committed_on = Time.gm(2010, 7, 5, 20, 34, 26)
assert_equal '4f26664364207fa8b1af9f8722647ab2d4ac5d43', rev_a_commit.scmid
assert_equal rev_a_committed_on, rev_a_commit.committed_on
latest_rev = @repository.latest_changeset
assert_equal rev_a_committed_on, latest_rev.committed_on
@repository.fetch_changesets @repository.fetch_changesets
assert_equal 16, @repository.changesets.count assert_equal 16, @repository.changesets.count
end end