]> source.dussan.org Git - redmine.git/commitdiff
scm: mercurial: add model entries test (#14361)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 2 Feb 2014 04:43:32 +0000 (04:43 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 2 Feb 2014 04:43:32 +0000 (04:43 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@12757 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/repository_mercurial_test.rb

index 0729a79d1bf90b5d40d1eac07bab2c573cb39a55..7ac4b66aaf5fb9e88629ee58f051201e13eea335 100644 (file)
@@ -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