diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 4e9f67d7d6..17e1dae9eb 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -16,7 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class MyController < ApplicationController - self.main_menu = false + menu_item :my_page before_action :require_login # let user change user's password when user has to skip_before_action :check_password_change, :only => :password diff --git a/lib/redmine.rb b/lib/redmine.rb index 6e7d109740..cf486b85ac 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -201,6 +201,7 @@ Redmine::MenuManager.map :account_menu do |menu| end Redmine::MenuManager.map :application_menu do |menu| + menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? } menu.push :projects, {:controller => 'projects', :action => 'index'}, :permission => nil, :caption => :label_project_plural diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb index 6a618c4a34..2f493c578e 100644 --- a/test/functional/my_controller_test.rb +++ b/test/functional/my_controller_test.rb @@ -35,6 +35,9 @@ class MyControllerTest < Redmine::ControllerTest get :page assert_response :success assert_select 'h2', 'My page' + assert_select '#main-menu' do + assert_select 'a.my-page.selected', 1 + end end def test_page_with_timelog_block