summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-14 14:35:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-14 14:35:57 +0000
commit4b6b568635739c938a1a889770fca4a390c4fe26 (patch)
treef2ca8e2ba9a0f6d33751f124d3847894efe7d462 /test
parent5aaf9c734cf976693a818407b3b07f1b3d0aee5a (diff)
downloadredmine-4b6b568635739c938a1a889770fca4a390c4fe26.tar.gz
redmine-4b6b568635739c938a1a889770fca4a390c4fe26.zip
Fixed that entering #nnn as parent task should validate (#11979).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10658 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/issues_controller_test.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 443cd8ab3..d1675c845 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -1940,12 +1940,24 @@ class IssuesControllerTest < ActionController::TestCase
post :create, :project_id => 1,
:issue => {:tracker_id => 1,
:subject => 'This is a child issue',
- :parent_issue_id => 2}
+ :parent_issue_id => '2'}
+ assert_response 302
+ end
+ issue = Issue.order('id DESC').first
+ assert_equal Issue.find(2), issue.parent
+ end
+
+ def test_post_create_subissue_with_sharp_parent_id
+ @request.session[:user_id] = 2
+ assert_difference 'Issue.count' do
+ post :create, :project_id => 1,
+ :issue => {:tracker_id => 1,
+ :subject => 'This is a child issue',
+ :parent_issue_id => '#2'}
assert_response 302
end
- issue = Issue.find_by_subject('This is a child issue')
- assert_not_nil issue
+ issue = Issue.order('id DESC').first
assert_equal Issue.find(2), issue.parent
end