From 7c7bbf6d184501041bc1c97795a01082dccad895 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Tue, 8 Mar 2011 07:06:46 +0000 Subject: [PATCH] scm: git: add latest changesets branch test in unit model test (#5357). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5056 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/repository_git_test.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/unit/repository_git_test.rb b/test/unit/repository_git_test.rb index 3783f9e6d..0c2f6a3c8 100644 --- a/test/unit/repository_git_test.rb +++ b/test/unit/repository_git_test.rb @@ -150,6 +150,32 @@ class RepositoryGitTest < ActiveSupport::TestCase assert_equal [ '899a15dba03a3b350b89c3f537e4bbe02a03cdc9', ], changesets.collect(&:revision) + + # with path, branch and limit + changesets = @repository.latest_changesets('images', 'test_branch') + assert_equal [ + '899a15dba03a3b350b89c3f537e4bbe02a03cdc9', + '7234cb2750b63f47bff735edc50a1c0a433c2518', + ], changesets.collect(&:revision) + + changesets = @repository.latest_changesets('images', 'test_branch', 1) + assert_equal [ + '899a15dba03a3b350b89c3f537e4bbe02a03cdc9', + ], changesets.collect(&:revision) + + changesets = @repository.latest_changesets('README', 'test_branch') + assert_equal [ + '713f4944648826f558cf548222f813dabe7cbb04', + '61b685fbe55ab05b5ac68402d5720c1a6ac973d1', + '899a15dba03a3b350b89c3f537e4bbe02a03cdc9', + '7234cb2750b63f47bff735edc50a1c0a433c2518', + ], changesets.collect(&:revision) + + changesets = @repository.latest_changesets('README', 'test_branch', 2) + assert_equal [ + '713f4944648826f558cf548222f813dabe7cbb04', + '61b685fbe55ab05b5ac68402d5720c1a6ac973d1', + ], changesets.collect(&:revision) end def test_find_changeset_by_name -- 2.39.5