7956.patch

Go MAEDA, 2020-05-27 15:43

Download (1.85 KB)

View differences:

lib/redmine.rb
303 303
  menu.push :overview, { :controller => 'projects', :action => 'show' }
304 304
  menu.push :activity, { :controller => 'activities', :action => 'index' }
305 305
  menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id,
306
            :if => Proc.new { |p| p.shared_versions.any? }
306
            :if => Proc.new { |p| Setting.display_subprojects_issues? ? p.rolled_up_versions.any? : p.shared_versions.any? }
307 307
  menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural
308 308
  menu.push :new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new,
309 309
            :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) },
test/integration/lib/redmine/menu_manager_test.rb
112 112
      assert_select 'a.project',      :count => 4
113 113
    end
114 114
  end
115

  
116
  def test_project_menu_should_show_roadmap_if_subprojects_have_versions
117
    Version.delete_all
118
    subproj = Project.find_by(identifier: 'subproject1')
119
    version = Version.generate!(project_id: subproj.id)
120

  
121
    with_settings :display_subprojects_issues => '1' do
122
      get '/projects/ecookbook'
123
      assert_select '#main-menu a.roadmap'
124
    end
125

  
126
    with_settings :display_subprojects_issues => '0' do
127
      get '/projects/ecookbook'
128
      assert_select '#main-menu a.roadmap', 0
129
    end
130
  end
115 131
end