0001-Fix-project-selector-on-global-new-issue-page-not-sh.patch

Marius BALTEANU, 2021-01-28 07:48

Download (1.73 KB)

View differences:

app/helpers/issues_helper.rb
746 746
  def projects_for_select(issue)
747 747
    if issue.parent_issue_id.present?
748 748
      issue.allowed_target_projects_for_subtask(User.current)
749
    elsif issue.new_record? && !issue.copy?
749
    elsif @project && issue.new_record? && !issue.copy?
750 750
      issue.allowed_target_projects(User.current, 'descendants')
751 751
    else
752 752
      issue.allowed_target_projects(User.current)
test/functional/issues_controller_test.rb
3170 3170
    end
3171 3171
  end
3172 3172

  
3173
  def test_get_new_global_should_show_all_projects
3174
    @request.session[:user_id] = 1
3175
    get :new
3176

  
3177
    assert_response :success
3178

  
3179
    assert_select 'select[name=?]', 'issue[project_id]' do
3180
      assert_select 'option[value=?]', '1'
3181
      assert_select 'option[value=?]', '2'
3182
    end
3183
  end
3184

  
3173 3185
  def test_get_new_should_show_project_selector_for_project_with_subprojects
3174 3186
    @request.session[:user_id] = 2
3175 3187
    get(
3176
-