summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-24 15:22:18 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-04-24 15:22:18 +0000
commit83d4c9c50b05df57ee36fe32eb0990806d960151 (patch)
treeebd22eb08e0cbc96e9430da04b9e4ce8be8afec2 /test
parent6376762917788a9a9daad35236fac46065a98cab (diff)
downloadredmine-83d4c9c50b05df57ee36fe32eb0990806d960151.tar.gz
redmine-83d4c9c50b05df57ee36fe32eb0990806d960151.zip
Do not propose trackers which disallow parent_issue_id for new child issues (#22345).
also removes the tracker_id from the "Add new child issue" link in case it doesn't allow parent_issue_id Patch by Jens Kraemer. git-svn-id: http://svn.redmine.org/redmine/trunk@15359 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/issues_controller_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 14489dcb8..0a021289a 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -2017,6 +2017,23 @@ class IssuesControllerTest < ActionController::TestCase
get :new, :project_id => 'invalid'
assert_response 404
end
+
+ def test_new_with_parent_id_should_only_propose_valid_trackers
+ @request.session[:user_id] = 2
+ t = Tracker.find(3)
+ assert !t.disabled_core_fields.include?('parent_issue_id')
+
+ get :new, :project_id => 1, issue: { parent_issue_id: 1 }
+ assert_response :success
+ assert_select 'option', text: /#{t.name}/, count: 1
+
+ t.core_fields = Tracker::CORE_FIELDS - ['parent_issue_id']
+ t.save!
+ assert t.disabled_core_fields.include?('parent_issue_id')
+ get :new, :project_id => 1, issue: { parent_issue_id: 1 }
+ assert_response :success
+ assert_select 'option', text: /#{t.name}/, count: 0
+ end
def test_update_form_for_new_issue
@request.session[:user_id] = 2