Merge pull request #4817 from ulferts/fix/onboarding_menu_performance

improve menu performance by rendering to existing controller
pull/4825/head
Oliver Günther 8 years ago committed by GitHub
commit 79bcf282a4
  1. 2
      app/controllers/application_controller.rb
  2. 4
      lib/redmine/menu_manager/top_menu/help_menu.rb
  3. 2
      spec/views/layouts/admin.html.erb_spec.rb
  4. 3
      spec/views/layouts/base.html.erb_spec.rb

@ -35,6 +35,8 @@ class ApplicationController < ActionController::Base
class_attribute :_model_scope
class_attribute :accept_key_auth_actions
helper_method :render_to_string
protected
include I18n

@ -71,9 +71,7 @@ module Redmine::MenuManager::TopMenu::HelpMenu
end
def render_onboarding_menu_item
controller = ApplicationController.new
controller.request = request
controller.render_to_string(partial: 'onboarding/menu_item')
render_to_string(partial: 'onboarding/menu_item')
end
def render_help_and_support(result)

@ -41,6 +41,8 @@ describe 'layouts/admin', type: :view do
allow(User).to receive(:current).and_return admin
allow(view).to receive(:current_user).and_return admin
allow(view)
.to receive(:render_to_string)
end
# All password-based authentication is to be hidden and disabled if

@ -43,6 +43,8 @@ describe 'layouts/base', type: :view do
allow(view).to receive(:current_menu_item).and_return('overview')
allow(view).to receive(:default_breadcrumb)
allow(controller).to receive(:default_search_scope)
allow(view)
.to receive(:render_to_string)
end
describe 'projects menu visibility' do
@ -131,7 +133,6 @@ describe 'layouts/base', type: :view do
end
end
describe 'icons' do
before do
allow(User).to receive(:current).and_return anonymous

Loading…
Cancel
Save