]> source.dussan.org Git - redmine.git/commitdiff
Merged r14984 (#21551).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Jan 2016 08:43:24 +0000 (08:43 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Jan 2016 08:43:24 +0000 (08:43 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@15016 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb
test/functional/issues_controller_transaction_test.rb

index f2dd1acd218c5e191572c4ed94b24b0e6e7d244a..29fc0c9f3934c9b28d0a620c1c10287672fac0cb 100644 (file)
@@ -388,7 +388,7 @@ class IssuesController < ApplicationController
         issue_attributes = issue_attributes.dup
         issue_attributes.delete(:lock_version)
       when 'add_notes'
-        issue_attributes = issue_attributes.slice(:notes)
+        issue_attributes = issue_attributes.slice(:notes, :private_notes)
       when 'cancel'
         redirect_to issue_path(@issue)
         return false
index b38b0964103ab8f028c3b382cbde215c272ca4e3..603b44a12c2aa8efe9585026465557eac142c709 100644 (file)
@@ -210,6 +210,27 @@ class IssuesControllerTransactionTest < ActionController::TestCase
     assert_nil issue.fixed_version_id
     journal = Journal.order('id DESC').first
     assert_equal 'add_notes_conflict_resolution', journal.notes
+    assert_equal false, journal.private_notes
+    assert journal.details.empty?
+  end
+
+  def test_update_stale_issue_with_add_notes_conflict_resolution_should_preserve_private_notes
+    @request.session[:user_id] = 2
+
+    journal = new_record(Journal) do
+      put :update, :id => 1,
+            :issue => {
+              :fixed_version_id => 4,
+              :notes => 'add_privates_notes_conflict_resolution',
+              :private_notes => '1',
+              :lock_version => 2
+            },
+            :conflict_resolution => 'add_notes'
+    end
+
+    assert_response 302
+    assert_equal 'add_privates_notes_conflict_resolution', journal.notes
+    assert_equal true, journal.private_notes
     assert journal.details.empty?
   end