From 9129d116b299ae0dd3636baba49b579ccaec356e Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 3 Nov 2011 08:03:38 +0000 Subject: [PATCH] scm: mercurial: test: model: add test of parents (#5501) git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7714 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/repository_mercurial_test.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb index f33640d11..7dc58f8fc 100644 --- a/test/unit/repository_mercurial_test.rb +++ b/test/unit/repository_mercurial_test.rb @@ -260,6 +260,25 @@ class RepositoryMercurialTest < ActiveSupport::TestCase end end + def test_parents + assert_equal 0, @repository.changesets.count + @repository.fetch_changesets + @project.reload + assert_equal NUM_REV, @repository.changesets.count + r1 = @repository.changesets.find_by_revision('0') + assert_equal [], r1.parents + r2 = @repository.changesets.find_by_revision('1') + assert_equal 1, r2.parents.length + assert_equal "0885933ad4f6", + r2.parents[0].identifier + r3 = @repository.changesets.find_by_revision('30') + assert_equal 2, r3.parents.length + assert_equal "a94b0528f24f", + r3.parents[0].identifier + assert_equal "3a330eb32958", + r3.parents[1].identifier + end + def test_activities c = Changeset.new(:repository => @repository, :committed_on => Time.now,