summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-11-03 08:02:53 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-11-03 08:02:53 +0000
commite0f7acaf6130833d1a0f1388f8c61058a7f91115 (patch)
tree3a5cbf6ace041e1dda3f45ec471694d7d616c1a4 /test
parentf63dc936ad274ca765f531b13595f63677529fc8 (diff)
downloadredmine-e0f7acaf6130833d1a0f1388f8c61058a7f91115.tar.gz
redmine-e0f7acaf6130833d1a0f1388f8c61058a7f91115.zip
scm: git: test: model: add test of parents (#5501)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7712 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/repository_git_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/repository_git_test.rb b/test/unit/repository_git_test.rb
index 78637cd77..54daa8e0d 100644
--- a/test/unit/repository_git_test.rb
+++ b/test/unit/repository_git_test.rb
@@ -173,6 +173,25 @@ class RepositoryGitTest < ActiveSupport::TestCase
assert_equal 15, @repository.changesets.count
end
+ def test_parents
+ assert_equal 0, @repository.changesets.count
+ @repository.fetch_changesets
+ @project.reload
+ assert_equal NUM_REV, @repository.changesets.count
+ r1 = @repository.find_changeset_by_name("7234cb2750b63")
+ assert_equal [], r1.parents
+ r2 = @repository.find_changeset_by_name("899a15dba03a3")
+ assert_equal 1, r2.parents.length
+ assert_equal "7234cb2750b63f47bff735edc50a1c0a433c2518",
+ r2.parents[0].identifier
+ r3 = @repository.find_changeset_by_name("32ae898b720c2")
+ assert_equal 2, r3.parents.length
+ assert_equal "4a07fe31bffcf2888791f3e6cbc9c4545cefe3e8",
+ r3.parents[0].identifier
+ assert_equal "7e61ac704deecde634b51e59daa8110435dcb3da",
+ r3.parents[1].identifier
+ end
+
def test_db_consistent_ordering_init
assert_nil @repository.extra_info
assert_equal 0, @repository.changesets.count