summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-01-01 00:59:07 +0000
committerGo MAEDA <maeda@farend.jp>2021-01-01 00:59:07 +0000
commit3f3514d8b1a6c7db39c7b0e180598437a210fac0 (patch)
tree39b2f8498584ffa36ff07baff92a38e6bf5bdc35 /test/functional
parent2ee2b349879a0816fc49700fade0be1750a6fa87 (diff)
downloadredmine-3f3514d8b1a6c7db39c7b0e180598437a210fac0.tar.gz
redmine-3f3514d8b1a6c7db39c7b0e180598437a210fac0.zip
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
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/issues_controller_test.rb24
1 files changed, 24 insertions, 0 deletions
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