##// END OF EJS Templates
Copying an issue does not copy parent task id (#12893)....
Jean-Philippe Lang -
r14676:ea635ece05b8
parent child
Show More
@@ -415,6 +415,7 class IssuesController < ApplicationController
415 415 @copy_attachments = params[:copy_attachments].present? || request.get?
416 416 @copy_subtasks = params[:copy_subtasks].present? || request.get?
417 417 @issue.copy_from(@copy_from, :attachments => @copy_attachments, :subtasks => @copy_subtasks, :link => @link_copy)
418 @issue.parent_issue_id = @copy_from.parent_id
418 419 rescue ActiveRecord::RecordNotFound
419 420 render_404
420 421 return
@@ -2775,6 +2775,14 class IssuesControllerTest < ActionController::TestCase
2775 2775 assert_select 'input[name=copy_attachments]', 0
2776 2776 end
2777 2777
2778 def test_new_as_copy_should_preserve_parent_id
2779 @request.session[:user_id] = 2
2780 issue = Issue.generate!(:parent_issue_id => 2)
2781 get :new, :project_id => 1, :copy_from => issue.id
2782
2783 assert_select 'input[name=?][value="2"]', 'issue[parent_issue_id]'
2784 end
2785
2778 2786 def test_new_as_copy_with_subtasks_should_show_copy_subtasks_checkbox
2779 2787 @request.session[:user_id] = 2
2780 2788 issue = Issue.generate_with_descendants!
General Comments 0
You need to be logged in to leave comments. Login now