diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-04-12 16:55:30 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-04-12 16:55:30 +0000 |
commit | 3d4d6c31f3b225b2c588cde559730515c2e246ff (patch) | |
tree | 2f3dabc647defd0077ee11c190100ea1e072c553 /test/functional | |
parent | 4c2c426af75f1db02d6ae4b0d75a602f8fa9de3a (diff) | |
download | redmine-3d4d6c31f3b225b2c588cde559730515c2e246ff.tar.gz redmine-3d4d6c31f3b225b2c588cde559730515c2e246ff.zip |
Merged r15318 and r15319 (#22342).
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@15329 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/issues_controller_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 92ee15c21..3c687c64b 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2982,6 +2982,24 @@ class IssuesControllerTest < ActionController::TestCase assert_equal issue.descendants.map(&:subject).sort, copy.descendants.map(&:subject).sort end + def test_create_as_copy_to_a_different_project_should_copy_subtask_custom_fields + issue = Issue.generate! {|i| i.custom_field_values = {'2' => 'Foo'}} + child = Issue.generate!(:parent_issue_id => issue.id) {|i| i.custom_field_values = {'2' => 'Bar'}} + @request.session[:user_id] = 1 + + assert_difference 'Issue.count', 2 do + post :create, :project_id => 'ecookbook', :copy_from => issue.id, + :issue => {:project_id => '2', :tracker_id => 1, :status_id => '1', + :subject => 'Copy with subtasks', :custom_field_values => {'2' => 'Foo'}}, + :copy_subtasks => '1' + end + + child_copy, issue_copy = Issue.order(:id => :desc).limit(2).to_a + assert_equal 2, issue_copy.project_id + assert_equal 'Foo', issue_copy.custom_field_value(2) + assert_equal 'Bar', child_copy.custom_field_value(2) + end + def test_create_as_copy_without_copy_subtasks_option_should_not_copy_subtasks @request.session[:user_id] = 2 issue = Issue.generate_with_descendants! |