diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-10-05 10:33:03 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-10-05 10:33:03 +0000 |
commit | 7b1b605ae8e6762f4bf76cecf32e280f75bf72c8 (patch) | |
tree | 2cb329d520e11f5d9deea6a995a3d4c7f5f57f47 /test | |
parent | 0444ecca3c876cae6ee4f83f41c4cd0bb7ee6f74 (diff) | |
download | redmine-7b1b605ae8e6762f4bf76cecf32e280f75bf72c8.tar.gz redmine-7b1b605ae8e6762f4bf76cecf32e280f75bf72c8.zip |
Don't update issues nor log time when importing old changesets (#4823).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12199 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/repositories.yml | 2 | ||||
-rw-r--r-- | test/unit/changeset_test.rb | 22 |
2 files changed, 24 insertions, 0 deletions
diff --git a/test/fixtures/repositories.yml b/test/fixtures/repositories.yml index 5be709a1d..20225bb22 100644 --- a/test/fixtures/repositories.yml +++ b/test/fixtures/repositories.yml @@ -8,6 +8,7 @@ repositories_001: login: "" type: Repository::Subversion is_default: true + created_on: 2006-07-19 19:04:21 +02:00 repositories_002: project_id: 2 url: svn://localhost/test @@ -17,3 +18,4 @@ repositories_002: login: "" type: Repository::Subversion is_default: true + created_on: 2006-07-19 19:04:21 +02:00 diff --git a/test/unit/changeset_test.rb b/test/unit/changeset_test.rb index 3ead6b843..93bd7bba5 100644 --- a/test/unit/changeset_test.rb +++ b/test/unit/changeset_test.rb @@ -254,6 +254,28 @@ class ChangesetTest < ActiveSupport::TestCase end end + def test_old_commits_should_not_update_issues_nor_log_time + Setting.commit_ref_keywords = '*' + Setting.commit_update_keywords = {'fixes , closes' => {'status_id' => '5', 'done_ratio' => '90'}} + Setting.commit_logtime_enabled = '1' + + repository = Project.find(1).repository + repository.created_on = Time.now + repository.save! + + c = Changeset.new(:repository => repository, + :committed_on => 1.month.ago, + :comments => 'New commit (#2). Fixes #1 @1h', + :revision => '12345') + assert_no_difference 'TimeEntry.count' do + assert c.save + end + assert_equal [1, 2], c.issue_ids.sort + issue = Issue.find(1) + assert_equal 1, issue.status_id + assert_equal 0, issue.done_ratio + end + def test_text_tag_revision c = Changeset.new(:revision => '520') assert_equal 'r520', c.text_tag |