From 3f3514d8b1a6c7db39c7b0e180598437a210fac0 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Fri, 1 Jan 2021 00:59:07 +0000 Subject: Show only valid projects on issue form when the issue is a subtask (#33419). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@20701 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/issues_controller_test.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/functional') diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index dda71f829..cb04adad6 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -3141,6 +3141,30 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select 'select[name="issue[project_id]"]', 0 end + def test_get_new_should_not_show_invalid_projects_when_issue_is_a_subtask + @request.session[:user_id] = 2 + issue = Issue.find(1) + issue.parent_id = 3 + issue.save + + with_settings :cross_project_subtasks => 'tree' do + get( + :new, + :params => { + :project_id => 1, + :parent_issue_id => 1 + } + ) + end + assert_response :success + assert_select 'select[name="issue[project_id]"]' do + assert_select 'option', 3 + + # Onlinestore project should not be included + assert_select 'option[value=?]', '2', 0 + end + end + def test_get_new_with_minimal_permissions Role.find(1).update_attribute :permissions, [:add_issues] WorkflowTransition.where(:role_id => 1).delete_all -- cgit v1.2.3