mirror of
				https://github.com/redmine/redmine.git
				synced 2025-10-31 10:25:55 +01:00 
			
		
		
		
	Show Roadmap tab when subprojects have defined versions (#7956).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@19801 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
		| @@ -303,7 +303,7 @@ Redmine::MenuManager.map :project_menu do |menu| | |||||||
|   menu.push :overview, { :controller => 'projects', :action => 'show' } |   menu.push :overview, { :controller => 'projects', :action => 'show' } | ||||||
|   menu.push :activity, { :controller => 'activities', :action => 'index' } |   menu.push :activity, { :controller => 'activities', :action => 'index' } | ||||||
|   menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id, |   menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id, | ||||||
|             :if => Proc.new { |p| p.shared_versions.any? } |             :if => Proc.new { |p| Setting.display_subprojects_issues? ? p.rolled_up_versions.any? : p.shared_versions.any? } | ||||||
|   menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural |   menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural | ||||||
|   menu.push :new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new, |   menu.push :new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new, | ||||||
|             :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, |             :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, | ||||||
|   | |||||||
| @@ -112,4 +112,20 @@ class MenuManagerTest < Redmine::IntegrationTest | |||||||
|       assert_select 'a.project',      :count => 4 |       assert_select 'a.project',      :count => 4 | ||||||
|     end |     end | ||||||
|   end |   end | ||||||
|  |  | ||||||
|  |   def test_project_menu_should_show_roadmap_if_subprojects_have_versions | ||||||
|  |     Version.delete_all | ||||||
|  |     # Create a version in the project "eCookbook Subproject 1" | ||||||
|  |     version = Version.generate!(project_id: 3) | ||||||
|  |  | ||||||
|  |     with_settings :display_subprojects_issues => '1' do | ||||||
|  |       get '/projects/ecookbook' | ||||||
|  |       assert_select '#main-menu a.roadmap' | ||||||
|  |     end | ||||||
|  |  | ||||||
|  |     with_settings :display_subprojects_issues => '0' do | ||||||
|  |       get '/projects/ecookbook' | ||||||
|  |       assert_select '#main-menu a.roadmap', 0 | ||||||
|  |     end | ||||||
|  |   end | ||||||
| end | end | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user