summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-07 20:16:30 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-07 20:16:30 +0000
commit174f014564b318feaab234aa3a16d4b579e74a7f (patch)
tree8737baf335d1347e100e7c63d46209c915e8b123
parent5266e328c029405ab132f4fb99a5ba9bc1d6ba67 (diff)
downloadredmine-174f014564b318feaab234aa3a16d4b579e74a7f.tar.gz
redmine-174f014564b318feaab234aa3a16d4b579e74a7f.zip
Fixes broken admin menu extension (#4351).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3131 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/views/admin/index.rhtml6
-rw-r--r--test/functional/admin_controller_test.rb15
2 files changed, 18 insertions, 3 deletions
diff --git a/app/views/admin/index.rhtml b/app/views/admin/index.rhtml
index 1a0684a13..3c96a9a0a 100644
--- a/app/views/admin/index.rhtml
+++ b/app/views/admin/index.rhtml
@@ -39,9 +39,9 @@
<%= link_to l(:label_settings), :controller => 'settings' %>
</p>
-<% menu_items_for(:admin_menu) do |item, caption, url, selected| -%>
- <%= content_tag 'p',
- link_to(h(caption), item.url, item.html_options),
+<% menu_items_for(:admin_menu) do |item| -%>
+ <%= content_tag 'p',
+ link_to(h(item.caption), item.url, item.html_options),
:class => ["icon22", "icon22-#{item.name}"].join(' ') %>
<% end -%>
diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb
index 47091c42f..142a374e9 100644
--- a/test/functional/admin_controller_test.rb
+++ b/test/functional/admin_controller_test.rb
@@ -120,6 +120,21 @@ class AdminControllerTest < ActionController::TestCase
assert_template 'info'
end
+ def test_admin_menu_plugin_extension
+ Redmine::MenuManager.map :admin_menu do |menu|
+ menu.push :test_admin_menu_plugin_extension, '/foo/bar', :caption => 'Test'
+ end
+
+ get :index
+ assert_response :success
+ assert_tag :a, :attributes => { :href => '/foo/bar' },
+ :content => 'Test'
+
+ Redmine::MenuManager.map :admin_menu do |menu|
+ menu.delete :test_admin_menu_plugin_extension
+ end
+ end
+
private
def delete_configuration_data