]> source.dussan.org Git - redmine.git/commitdiff
Fix cannot change the default version under settings (#34982).
authorGo MAEDA <maeda@farend.jp>
Wed, 31 Mar 2021 08:28:32 +0000 (08:28 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 31 Mar 2021 08:28:32 +0000 (08:28 +0000)
Patch by  Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@20875 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/projects/settings/_issues.html.erb
test/functional/projects_controller_test.rb

index aef3a9a22aeacc55cbc0d5a61586225e418f75b1..27e792d22fe9e7a5d38a9b459c75bec3593bc789 100644 (file)
@@ -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? %>
index 248dc18007025d8a7d902a44462c6fe5c9f480f1..7506d3ba1b00512dd206bb9831115250b09dd923 100644 (file)
@@ -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(