From: Toshi MARUYAMA Date: Sun, 2 Feb 2014 04:43:32 +0000 (+0000) Subject: scm: mercurial: add model entries test (#14361) X-Git-Tag: 2.5.0~143 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1662720d7b993812bf59842dac47fb4bca7da58e;p=redmine.git scm: mercurial: add model entries test (#14361) git-svn-id: http://svn.redmine.org/redmine/trunk@12757 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- 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