diff options
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/issues_controller_test.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index fdd995c56..b6e583fda 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2357,6 +2357,19 @@ class IssuesControllerTest < ActionController::TestCase assert_equal count + 1, copy.attachments.count end + def test_create_as_copy_should_add_relation_with_copied_issue + @request.session[:user_id] = 2 + + assert_difference 'Issue.count' do + assert_difference 'IssueRelation.count' do + post :create, :project_id => 1, :copy_from => 1, + :issue => {:project_id => '1', :tracker_id => '3', :status_id => '1', :subject => 'Copy'} + end + end + copy = Issue.first(:order => 'id DESC') + assert_equal 1, copy.relations.size + end + def test_create_as_copy_should_copy_subtasks @request.session[:user_id] = 2 issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent') @@ -3512,6 +3525,19 @@ class IssuesControllerTest < ActionController::TestCase end end + def test_bulk_copy_should_add_relations_with_copied_issues + @request.session[:user_id] = 2 + + assert_difference 'Issue.count', 2 do + assert_difference 'IssueRelation.count', 2 do + post :bulk_update, :ids => [1, 3], :copy => '1', + :issue => { + :project_id => '1' + } + end + end + end + def test_bulk_copy_should_allow_not_copying_the_subtasks issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent') @request.session[:user_id] = 2 |