:if => Proc.new { |p| p.shared_versions.any? }
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,
- :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }
+ :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) },
+ :if => Proc.new { |p| p.trackers.any? }
menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt
menu.push :calendar, { :controller => 'calendars', :action => 'show' }, :param => :project_id, :caption => :label_calendar
menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural
get :show, :id => 1
assert_select 'body.project-ecookbook'
end
+
+ def test_project_menu_should_include_new_issue_link
+ @request.session[:user_id] = 2
+ get :show, :id => 1
+ assert_select '#main-menu a.new-issue[href="/projects/ecookbook/issues/new"]', :text => 'New issue'
+ end
+
+ def test_project_menu_should_not_include_new_issue_link_for_project_without_trackers
+ Project.find(1).trackers.clear
+
+ @request.session[:user_id] = 2
+ get :show, :id => 1
+ assert_select '#main-menu a.new-issue', 0
+ end
end