summaryrefslogtreecommitdiffstats
path: root/test/unit/repository_git_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-10 07:25:27 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-02-10 07:25:27 +0000
commit4d5d51e322401ce87301790df4ae720195569874 (patch)
tree00f164bbee08553f465d70d60f3d631e6c47fc93 /test/unit/repository_git_test.rb
parent2cfdb8306d0ec1dce9d969cb31dca2787510ee3e (diff)
downloadredmine-4d5d51e322401ce87301790df4ae720195569874.tar.gz
redmine-4d5d51e322401ce87301790df4ae720195569874.zip
scm: git: clarify the purpose of the unit model test to fetch history editing revisions
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8832 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_git_test.rb')
-rw-r--r--test/unit/repository_git_test.rb30
1 files changed, 17 insertions, 13 deletions
diff --git a/test/unit/repository_git_test.rb b/test/unit/repository_git_test.rb
index 4d01eed2c..03e38237a 100644
--- a/test/unit/repository_git_test.rb
+++ b/test/unit/repository_git_test.rb
@@ -130,17 +130,14 @@ class RepositoryGitTest < ActiveSupport::TestCase
assert_equal NUM_REV, @repository.changesets.count
end
- def test_fetch_changesets_invalid_rev
+ def test_fetch_changesets_history_editing
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets
@project.reload
assert_equal NUM_REV, @repository.changesets.count
- extra_info_db = @repository.extra_info["branches"]
- assert_equal 5, extra_info_db.size
- assert_equal "1ca7f5ed374f3cb31a93ae5215c2e25cc6ec5127",
- extra_info_db["latin-1-path-encoding"]["last_scmid"]
+ assert_equal 5, @repository.extra_info["branches"].size
assert_equal "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c",
- extra_info_db["master"]["last_scmid"]
+ @repository.extra_info["branches"]["master"]["last_scmid"]
del_revs = [
"83ca5fd546063a3c7dc2e568ba3355661a9e2b2c",
@@ -154,21 +151,28 @@ class RepositoryGitTest < ActiveSupport::TestCase
rev.destroy if del_revs.detect {|r| r == rev.scmid.to_s }
end
@project.reload
- cs1 = @repository.changesets
- assert_equal 22, cs1.count
+ assert_equal NUM_REV - 6, @repository.changesets.count
+
+ c = Changeset.new(:repository => @repository,
+ :committed_on => Time.now,
+ :revision => "abcd1234efgh",
+ :scmid => "abcd1234efgh",
+ :comments => 'test')
+ assert c.save
+ @project.reload
+ assert_equal NUM_REV - 5, @repository.changesets.count
+
h = @repository.extra_info.dup
- h["branches"]["master"]["last_scmid"] =
- "abcd1234efgh"
+ h["branches"]["master"]["last_scmid"] = "abcd1234efgh"
@repository.merge_extra_info(h)
@repository.save
@project.reload
- extra_info_db_1 = @repository.extra_info["branches"]
assert_equal "abcd1234efgh",
- extra_info_db_1["master"]["last_scmid"]
+ @repository.extra_info["branches"]["master"]["last_scmid"]
@repository.fetch_changesets
@project.reload
- assert_equal 22, @repository.changesets.count
+ assert_equal NUM_REV - 5, @repository.changesets.count
end
def test_parents