]> source.dussan.org Git - redmine.git/commitdiff
Merged r15196 (#22072).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 12 Mar 2016 10:03:41 +0000 (10:03 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 12 Mar 2016 10:03:41 +0000 (10:03 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@15207 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb
test/unit/issue_test.rb

index ba7a9b159e0bd30f7cc8e1691d55c59d942f2fb8..59cb3c17a0d39e1a00d7f609ec3fdf8c6fe51bad 100644 (file)
@@ -1626,6 +1626,7 @@ class Issue < ActiveRecord::Base
         # Same user and notes
         if @current_journal
           duplicate.init_journal(@current_journal.user, @current_journal.notes)
+          duplicate.private_notes = @current_journal.private_notes
         end
         duplicate.update_attribute :status, self.status
       end
index 8527554734db10f9fae52eb7e4f9e7f1d1e6c84f..468a3f44fd63a1cc161b8917c5f6019007d41c81 100644 (file)
@@ -1274,6 +1274,24 @@ class IssueTest < ActiveSupport::TestCase
     assert issue3.reload.closed?
   end
 
+  def test_should_close_duplicates_with_private_notes
+    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)
+
+    # Closing issue with private notes
+    issue.init_journal(User.first, "Private notes")
+    issue.private_notes = true
+    issue.status = IssueStatus.where(:is_closed => true).first
+    assert_save issue
+
+    duplicate.reload
+    assert journal = duplicate.journals.detect {|journal| journal.notes == "Private notes"}
+    assert_equal true, journal.private_notes
+  end
+
   def test_should_not_close_duplicated_issue
     issue1 = Issue.generate!
     issue2 = Issue.generate!