summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-11-03 08:03:38 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-11-03 08:03:38 +0000
commit9129d116b299ae0dd3636baba49b579ccaec356e (patch)
tree0c01826dd676c731ec0d4c6fa5782c4dbb414c27
parentd10102e940b7779f2f1f472019fa2c4304beaa7a (diff)
downloadredmine-9129d116b299ae0dd3636baba49b579ccaec356e.tar.gz
redmine-9129d116b299ae0dd3636baba49b579ccaec356e.zip
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
-rw-r--r--test/unit/repository_mercurial_test.rb19
1 files changed, 19 insertions, 0 deletions
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,