diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-09-27 19:09:30 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-09-27 19:09:30 +0000 |
commit | cc4cff9f11b453c6fe308da6867819b4717e8d1a (patch) | |
tree | d2677bbc67877f5879a4ff3392e32bcf7c0fbfc0 /test/functional | |
parent | c3e055bd700bdcd09c700d20d1c309b55e46a0e8 (diff) | |
download | redmine-cc4cff9f11b453c6fe308da6867819b4717e8d1a.tar.gz redmine-cc4cff9f11b453c6fe308da6867819b4717e8d1a.zip |
Adds a "Copied from/to" relation when copying issue(s) (#6899).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10491 e93f8b46-1217-0410-a6f0-8f06a7374b81
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 |