summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_nested_set_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-10 17:38:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-10 17:38:17 +0000
commit83bcc1f043511d85414ca3cafc1e10dc84b9da24 (patch)
treead4f5fb681005732796c43266467c2e59228db79 /test/unit/issue_nested_set_test.rb
parentb0013d9f68a0ce4347f568b7f8809ea8ef9f1d8b (diff)
downloadredmine-83bcc1f043511d85414ca3cafc1e10dc84b9da24.tar.gz
redmine-83bcc1f043511d85414ca3cafc1e10dc84b9da24.zip
Adds a setting to allow subtasks to belong to other projects (#5487).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10587 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_nested_set_test.rb')
-rw-r--r--test/unit/issue_nested_set_test.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/unit/issue_nested_set_test.rb b/test/unit/issue_nested_set_test.rb
index 6716759b5..921cddc99 100644
--- a/test/unit/issue_nested_set_test.rb
+++ b/test/unit/issue_nested_set_test.rb
@@ -49,7 +49,15 @@ class IssueNestedSetTest < ActiveSupport::TestCase
assert_equal [parent.id, parent.id, 2, 3], [child.root_id, child.parent_id, child.lft, child.rgt]
end
- def test_creating_a_child_in_different_project_should_not_validate
+ def test_creating_a_child_in_a_subproject_should_validate
+ issue = create_issue!
+ child = Issue.new(:project_id => 3, :tracker_id => 2, :author_id => 1,
+ :subject => 'child', :parent_issue_id => issue.id)
+ assert_save child
+ assert_equal issue, child.reload.parent
+ end
+
+ def test_creating_a_child_in_an_invalid_project_should_not_validate
issue = create_issue!
child = Issue.new(:project_id => 2, :tracker_id => 1, :author_id => 1,
:subject => 'child', :parent_issue_id => issue.id)