summaryrefslogtreecommitdiffstats
path: root/test/unit/repository_git_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-09 00:11:03 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-09 00:11:03 +0000
commit693191e8bf55663c1b5d0273189df56e77bbacc2 (patch)
treefa92a09c5da47d9108e8b1d956f701582d46a558 /test/unit/repository_git_test.rb
parent34b3a9851f6a0c78c9b057c80ea778d3b5d8c5a3 (diff)
downloadredmine-693191e8bf55663c1b5d0273189df56e77bbacc2.tar.gz
redmine-693191e8bf55663c1b5d0273189df56e77bbacc2.zip
scm: git: add model method to get heads from extra_info branches hash (#8857)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8816 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_git_test.rb')
-rw-r--r--test/unit/repository_git_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/unit/repository_git_test.rb b/test/unit/repository_git_test.rb
index 0e2d16ebc..c40f4df14 100644
--- a/test/unit/repository_git_test.rb
+++ b/test/unit/repository_git_test.rb
@@ -244,6 +244,22 @@ class RepositoryGitTest < ActiveSupport::TestCase
assert_equal 0, @repository.extra_info["db_consistent"]["ordering"]
end
+ def test_heads_from_branches_hash
+ assert_nil @repository.extra_info
+ assert_equal 0, @repository.changesets.count
+ assert_equal [], @repository.heads_from_branches_hash
+ h = {}
+ h["branches"] = {}
+ h["branches"]["test1"] = {}
+ h["branches"]["test1"]["last_scmid"] = "1234abcd"
+ h["branches"]["test2"] = {}
+ h["branches"]["test2"]["last_scmid"] = "abcd1234"
+ @repository.merge_extra_info(h)
+ @repository.save
+ @project.reload
+ assert_equal ["1234abcd", "abcd1234"], @repository.heads_from_branches_hash.sort
+ end
+
def test_latest_changesets
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets