summaryrefslogtreecommitdiffstats
path: root/test/functional/issues_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-08 06:14:35 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-08 06:14:35 +0000
commitb72d40a4292ab43b1a09b8b214b90574c5aba140 (patch)
treebf83f7f30618e5a0eb6d54922900133264fdb507 /test/functional/issues_controller_test.rb
parent6a37151b5cd0086b53b6c9fd336ff143c4defd42 (diff)
downloadredmine-b72d40a4292ab43b1a09b8b214b90574c5aba140.tar.gz
redmine-b72d40a4292ab43b1a09b8b214b90574c5aba140.zip
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
Diffstat (limited to 'test/functional/issues_controller_test.rb')
-rw-r--r--test/functional/issues_controller_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 9488b5331..fdd995c56 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -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'