From 1662720d7b993812bf59842dac47fb4bca7da58e Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sun, 2 Feb 2014 04:43:32 +0000 Subject: [PATCH] scm: mercurial: add model entries test (#14361) git-svn-id: http://svn.redmine.org/redmine/trunk@12757 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/repository_mercurial_test.rb | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb index 0729a79d1..7ac4b66aa 100644 --- a/test/unit/repository_mercurial_test.rb +++ b/test/unit/repository_mercurial_test.rb @@ -80,11 +80,29 @@ class RepositoryMercurialTest < ActiveSupport::TestCase assert_equal true, klass.scm_available end - def test_entries + def test_entries_on_tip entries = @repository.entries assert_kind_of Redmine::Scm::Adapters::Entries, entries end + def test_entries_short_id + assert_equal 0, @repository.changesets.count + @repository.fetch_changesets + @project.reload + assert_equal NUM_REV, @repository.changesets.count + [2, '400bb8672109', '400', 400].each do |r| + entries1 = @repository.entries(nil, r) + assert entries1 + assert_kind_of Redmine::Scm::Adapters::Entries, entries1 + assert_equal 3, entries1.size + readme = entries1[2] + assert_equal '1', readme.lastrev.revision + assert_equal '9d5b5b004199', readme.lastrev.identifier + assert_equal '1', readme.changeset.revision + assert_equal '9d5b5b004199', readme.changeset.scmid + end + end + def test_fetch_changesets_from_scratch assert_equal 0, @repository.changesets.count @repository.fetch_changesets -- 2.39.5