summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-12 13:40:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-12 13:40:41 +0000
commit2b797fa82fdd18ec2b3e1c67642278136be68184 (patch)
tree910ab79367e3b9b746de39252581fc06a1c09c31 /test/unit/issue_test.rb
parent8358dc1cc513d75e1365c1b50cedf613eb1d0556 (diff)
downloadredmine-2b797fa82fdd18ec2b3e1c67642278136be68184.tar.gz
redmine-2b797fa82fdd18ec2b3e1c67642278136be68184.zip
Fixed: No validation errors when entering an invalid "Parent task" (#11979).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10615 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_test.rb')
-rw-r--r--test/unit/issue_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index 0747f5c84..365ecad68 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -92,6 +92,20 @@ class IssueTest < ActiveSupport::TestCase
end
end
+ def test_create_with_parent_issue_id
+ issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :subject => 'Group assignment', :parent_issue_id => 1)
+ assert_save issue
+ assert_equal 1, issue.parent_issue_id
+ assert_equal Issue.find(1), issue.parent
+ end
+
+ def test_create_with_invalid_parent_issue_id
+ issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :subject => 'Group assignment', :parent_issue_id => '01ABC')
+ assert !issue.save
+ assert_equal '01ABC', issue.parent_issue_id
+ assert_include 'Parent task is invalid', issue.errors.full_messages
+ end
+
def assert_visibility_match(user, issues)
assert_equal issues.collect(&:id).sort, Issue.all.select {|issue| issue.visible?(user)}.collect(&:id).sort
end