summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-20 16:41:31 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-20 16:41:31 +0000
commitf99535bba2840b141a6f836e152397bc706ddeb4 (patch)
tree397d930b681fe72cda875e10c1a3503664ef482d /test/functional
parentd0888b2f719956a3156af6fced1b98c60675f06a (diff)
downloadredmine-f99535bba2840b141a6f836e152397bc706ddeb4.tar.gz
redmine-f99535bba2840b141a6f836e152397bc706ddeb4.zip
"Parent task is invalid" while editing child issues with restricted Issues Visibility (#12851).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11228 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/issues_controller_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index b27978171..de4c717c2 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -2916,6 +2916,20 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal spent_hours_before + 2.5, issue.spent_hours
end
+ def test_put_update_should_preserve_parent_issue_even_if_not_visible
+ parent = Issue.generate!(:project_id => 1, :is_private => true)
+ issue = Issue.generate!(:parent_issue_id => parent.id)
+ assert !parent.visible?(User.find(3))
+ @request.session[:user_id] = 3
+
+ get :edit, :id => issue.id
+ assert_select 'input[name=?][value=?]', 'issue[parent_issue_id]', parent.id.to_s
+
+ put :update, :id => issue.id, :issue => {:subject => 'New subject', :parent_issue_id => parent.id.to_s}
+ assert_response 302
+ assert_equal parent, issue.parent
+ end
+
def test_put_update_with_attachment_only
set_tmp_attachments_directory