@@ -388,7 +388,7 class IssuesController < ApplicationController | |||||
388 | issue_attributes = issue_attributes.dup |
|
388 | issue_attributes = issue_attributes.dup | |
389 | issue_attributes.delete(:lock_version) |
|
389 | issue_attributes.delete(:lock_version) | |
390 | when 'add_notes' |
|
390 | when 'add_notes' | |
391 | issue_attributes = issue_attributes.slice(:notes) |
|
391 | issue_attributes = issue_attributes.slice(:notes, :private_notes) | |
392 | when 'cancel' |
|
392 | when 'cancel' | |
393 | redirect_to issue_path(@issue) |
|
393 | redirect_to issue_path(@issue) | |
394 | return false |
|
394 | return false |
@@ -210,6 +210,27 class IssuesControllerTransactionTest < ActionController::TestCase | |||||
210 | assert_nil issue.fixed_version_id |
|
210 | assert_nil issue.fixed_version_id | |
211 | journal = Journal.order('id DESC').first |
|
211 | journal = Journal.order('id DESC').first | |
212 | assert_equal 'add_notes_conflict_resolution', journal.notes |
|
212 | assert_equal 'add_notes_conflict_resolution', journal.notes | |
|
213 | assert_equal false, journal.private_notes | |||
|
214 | assert journal.details.empty? | |||
|
215 | end | |||
|
216 | ||||
|
217 | def test_update_stale_issue_with_add_notes_conflict_resolution_should_preserve_private_notes | |||
|
218 | @request.session[:user_id] = 2 | |||
|
219 | ||||
|
220 | journal = new_record(Journal) do | |||
|
221 | put :update, :id => 1, | |||
|
222 | :issue => { | |||
|
223 | :fixed_version_id => 4, | |||
|
224 | :notes => 'add_privates_notes_conflict_resolution', | |||
|
225 | :private_notes => '1', | |||
|
226 | :lock_version => 2 | |||
|
227 | }, | |||
|
228 | :conflict_resolution => 'add_notes' | |||
|
229 | end | |||
|
230 | ||||
|
231 | assert_response 302 | |||
|
232 | assert_equal 'add_privates_notes_conflict_resolution', journal.notes | |||
|
233 | assert_equal true, journal.private_notes | |||
213 | assert journal.details.empty? |
|
234 | assert journal.details.empty? | |
214 | end |
|
235 | end | |
215 |
|
236 |
General Comments 0
You need to be logged in to leave comments.
Login now