summaryrefslogtreecommitdiffstats
path: root/test/unit/changeset_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-05 12:10:33 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-05 12:10:33 +0000
commita5675463352040ae8e63b0ba6c20a27dbfefc0d3 (patch)
tree5c5d97326aa0a81d96edee9563e2e90cf70d4a6d /test/unit/changeset_test.rb
parent8b678837a353747f6f4fcce343c603daf1e07fbe (diff)
downloadredmine-a5675463352040ae8e63b0ba6c20a27dbfefc0d3.tar.gz
redmine-a5675463352040ae8e63b0ba6c20a27dbfefc0d3.zip
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
Diffstat (limited to 'test/unit/changeset_test.rb')
-rw-r--r--test/unit/changeset_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/changeset_test.rb b/test/unit/changeset_test.rb
index da78417b1..0467d59a1 100644
--- a/test/unit/changeset_test.rb
+++ b/test/unit/changeset_test.rb
@@ -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