summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-25 11:40:58 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-06-25 11:40:58 +0000
commitdd650c5c2602df95524dda91620a6b2016fa1c27 (patch)
treeef2df338bbec32dfe30afd349ce4e6240f4e70a7 /test/unit/issue_test.rb
parentbd9e5447eac4a148c235d83a665af54c8e1fb335 (diff)
downloadredmine-dd650c5c2602df95524dda91620a6b2016fa1c27.tar.gz
redmine-dd650c5c2602df95524dda91620a6b2016fa1c27.zip
Setting to disable automatic closing of duplicates (#26192).
git-svn-id: http://svn.redmine.org/redmine/trunk@16697 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_test.rb')
-rw-r--r--test/unit/issue_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index 82c1a2720..df242a169 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -1436,6 +1436,23 @@ class IssueTest < ActiveSupport::TestCase
assert issue3.reload.closed?
end
+ def test_should_not_close_duplicate_when_disabled
+ issue = Issue.generate!
+ duplicate = Issue.generate!
+
+ IssueRelation.create!(:issue_from => duplicate, :issue_to => issue,
+ :relation_type => IssueRelation::TYPE_DUPLICATES)
+ assert issue.reload.duplicates.include?(duplicate)
+
+ with_settings :close_duplicate_issues => '0' do
+ issue.init_journal(User.first, "Closing issue")
+ issue.status = IssueStatus.where(:is_closed => true).first
+ issue.save
+ end
+
+ assert !duplicate.reload.closed?
+ end
+
def test_should_close_duplicates_with_private_notes
issue = Issue.generate!
duplicate = Issue.generate!