From: Go MAEDA Date: Wed, 31 Mar 2021 08:28:32 +0000 (+0000) Subject: Fix cannot change the default version under settings (#34982). X-Git-Tag: 5.0.0~481 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e9f9767089a4e3efbd73c35fc55c5c7eb85dd7d3;p=redmine.git Fix cannot change the default version under settings (#34982). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@20875 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/views/projects/settings/_issues.html.erb b/app/views/projects/settings/_issues.html.erb index aef3a9a22..27e792d22 100644 --- a/app/views/projects/settings/_issues.html.erb +++ b/app/views/projects/settings/_issues.html.erb @@ -1,4 +1,4 @@ -<%= labelled_form_for @project, as: 'project_issue_tracking' do |f| %> +<%= labelled_form_for @project, html: {id: 'project_issue_tracking' } do |f| %> <%= hidden_field_tag 'tab', 'issues' %> <% unless @trackers.empty? %> diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 248dc1800..7506d3ba1 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -915,6 +915,28 @@ class ProjectsControllerTest < Redmine::ControllerTest assert_select 'select#project_custom_field_values_3', :count => 0 end + def test_settings_issue_tracking + @request.session[:user_id] = 1 + project = Project.find(1) + project.default_version_id = 3 + project.save! + + get( + :settings, + :params => { + :id => 'ecookbook', + :tab => 'issues', + } + ) + assert_response :success + + assert_select 'form[id=?]', 'project_issue_tracking', 1 + assert_select 'input[name=?]', 'project[tracker_ids][]' + assert_select 'input[name=?]', 'project[issue_custom_field_ids][]' + assert_select 'select[name=?]', 'project[default_version_id]', 1 + assert_select 'select[name=?]', 'project[default_assigned_to_id]', 1 + end + def test_update @request.session[:user_id] = 2 # manager post(