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
This commit is contained in:
Jean-Philippe Lang
2012-09-27 19:09:30 +00:00
parent c3e055bd70
commit cc4cff9f11
6 changed files with 61 additions and 5 deletions
+13
View File
@@ -636,6 +636,19 @@ class IssueTest < ActiveSupport::TestCase
assert_equal orig.status, issue.status
end
def test_copy_should_add_relation_with_copied_issue
copied = Issue.find(1)
issue = Issue.new.copy_from(copied)
assert issue.save
issue.reload
assert_equal 1, issue.relations.size
relation = issue.relations.first
assert_equal 'copied_to', relation.relation_type
assert_equal copied, relation.issue_from
assert_equal issue, relation.issue_to
end
def test_copy_should_copy_subtasks
issue = Issue.generate_with_descendants!(Project.find(1), :subject => 'Parent')