diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-01-10 15:31:50 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-01-10 15:31:50 +0000 |
commit | 300e5e4652083cae3c5bce3d021f5a1745ae4e5c (patch) | |
tree | 433926b97bba6c4c92b55ed117446da09936171c /test/unit | |
parent | 3a48f09d4f11b0da737007900c16d7fd95eee767 (diff) | |
download | redmine-300e5e4652083cae3c5bce3d021f5a1745ae4e5c.tar.gz redmine-300e5e4652083cae3c5bce3d021f5a1745ae4e5c.zip |
After copying a task, setting the parent as the orignal task's parent triggers an error (#17580).
git-svn-id: http://svn.redmine.org/redmine/trunk@15057 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/issue_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index f4f239834..34697d548 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -1963,6 +1963,23 @@ class IssueTest < ActiveSupport::TestCase assert IssueRelation.exists?(relation.id) end + def test_issue_copy_should_be_able_to_be_moved_to_the_same_parent_as_copied_issue + issue = Issue.generate! + parent = Issue.generate! + issue.parent_issue_id = parent.id + issue.save! + issue.reload + + copy = Issue.new.copy_from(issue, :link => true) + relation = new_record(IssueRelation) do + copy.save! + end + + copy.parent_issue_id = parent.id + assert_save copy + assert IssueRelation.exists?(relation.id) + end + def test_overdue assert Issue.new(:due_date => 1.day.ago.to_date).overdue? assert !Issue.new(:due_date => Date.today).overdue? |