summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-10-12 14:32:24 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-10-12 14:32:24 +0000
commitb537a2f1decb13d549d1a4a6be0fb8a4cfa092b0 (patch)
tree26d53197c6af610f0f2b65d86992b818a6bac396
parent7af1504672d846eb19d98ab42a5eed36aae8cd54 (diff)
downloadredmine-b537a2f1decb13d549d1a4a6be0fb8a4cfa092b0.tar.gz
redmine-b537a2f1decb13d549d1a4a6be0fb8a4cfa092b0.zip
add test of parent issue id beginning sharp to unit issue test (#11979)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10617 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--test/unit/issue_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index 365ecad68..a1b9d4de7 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -99,6 +99,15 @@ class IssueTest < ActiveSupport::TestCase
assert_equal Issue.find(1), issue.parent
end
+ def test_create_with_sharp_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
@@ -106,6 +115,16 @@ class IssueTest < ActiveSupport::TestCase
assert_include 'Parent task is invalid', issue.errors.full_messages
end
+ def test_create_with_invalid_sharp_parent_issue_id
+ set_language_if_valid 'en'
+ 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