mirror of
https://github.com/redmine/redmine.git
synced 2025-11-08 22:36:02 +01:00
Do not copy subtasks twice when copying an issue and its descendants (#6965).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10329 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -3539,6 +3539,21 @@ class IssuesControllerTest < ActionController::TestCase
|
||||
assert_equal count, copy.descendants.count
|
||||
end
|
||||
|
||||
def test_bulk_copy_should_not_copy_selected_subtasks_twice
|
||||
issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')
|
||||
count = issue.descendants.count
|
||||
@request.session[:user_id] = 2
|
||||
|
||||
assert_difference 'Issue.count', count+1 do
|
||||
post :bulk_update, :ids => issue.self_and_descendants.map(&:id), :copy => '1', :copy_subtasks => '1',
|
||||
:issue => {
|
||||
:project_id => ''
|
||||
}
|
||||
end
|
||||
copy = Issue.where(:parent_id => nil).order("id DESC").first
|
||||
assert_equal count, copy.descendants.count
|
||||
end
|
||||
|
||||
def test_bulk_copy_to_another_project_should_follow_when_needed
|
||||
@request.session[:user_id] = 2
|
||||
post :bulk_update, :ids => [1], :copy => '1', :issue => {:project_id => 2}, :follow => '1'
|
||||
|
||||
Reference in New Issue
Block a user