Patch #29185 » diff.patch
| app/controllers/my_controller.rb | ||
|---|---|---|
|
# 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
|
||
| lib/redmine.rb | ||
|---|---|---|
|
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
|
||
| test/functional/my_controller_test.rb | ||
|---|---|---|
|
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
|
||
- « Previous
- 1
- 2
- Next »