summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_nested_set_test.rb
diff options
context:
space:
mode:
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)