Project

General

Profile

Defect #34982 » 0001-Fix-cannot-change-the-default-version-under-settings.patch

Marius BĂLTEANU, 2021-03-30 17:53

View differences:

app/views/projects/settings/_issues.html.erb
1
<%= labelled_form_for @project, as: 'project_issue_tracking' do |f| %>
1
<%= labelled_form_for @project, html: {id: 'project_issue_tracking' } do |f| %>
2 2
  <%= hidden_field_tag 'tab', 'issues' %>
3 3

  
4 4
  <% unless @trackers.empty? %>
test/functional/projects_controller_test.rb
915 915
    assert_select 'select#project_custom_field_values_3', :count => 0
916 916
  end
917 917

  
918
  def test_settings_issue_tracking
919
    @request.session[:user_id] = 1
920
    project = Project.find(1)
921
    project.default_version_id = 3
922
    project.save!
923

  
924
    get(
925
      :settings,
926
      :params => {
927
        :id => 'ecookbook',
928
        :tab => 'issues',
929
      }
930
    )
931
    assert_response :success
932

  
933
    assert_select 'form[id=?]', 'project_issue_tracking', 1
934
    assert_select 'input[name=?]', 'project[tracker_ids][]'
935
    assert_select 'input[name=?]', 'project[issue_custom_field_ids][]'
936
    assert_select 'select[name=?]', 'project[default_version_id]', 1
937
    assert_select 'select[name=?]', 'project[default_assigned_to_id]', 1
938
  end
939

  
918 940
  def test_update
919 941
    @request.session[:user_id] = 2 # manager
920 942
    post(
(3-3/3)