Don't link multiple changesets from the same commit multiple times (#17931).

git-svn-id: http://svn.redmine.org/redmine/trunk@13427 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2014-10-05 12:10:33 +00:00
parent 8b678837a3
commit a567546335
3 changed files with 30 additions and 1 deletions

View File

@@ -297,6 +297,17 @@ class ChangesetTest < ActiveSupport::TestCase
assert_equal 0, issue.done_ratio
end
def test_2_repositories_with_same_backend_should_not_link_issue_multiple_times
Setting.commit_ref_keywords = '*'
r1 = Repository::Subversion.create!(:project_id => 1, :identifier => 'svn1', :url => 'file:///svn1')
r2 = Repository::Subversion.create!(:project_id => 1, :identifier => 'svn2', :url => 'file:///svn1')
now = Time.now
assert_difference 'Issue.find(1).changesets.count' do
c1 = Changeset.create!(:repository => r1, :committed_on => now, :comments => 'Fixes #1', :revision => '12345')
c1 = Changeset.create!(:repository => r2, :committed_on => now, :comments => 'Fixes #1', :revision => '12345')
end
end
def test_text_tag_revision
c = Changeset.new(:revision => '520')
assert_equal 'r520', c.text_tag