From 4d2dd08289d10bd161ae9c55bf8dcbe712d70008 Mon Sep 17 00:00:00 2001 From: Martin Linkhorst Date: Mon, 6 Aug 2012 11:25:21 +0200 Subject: [PATCH] fix menu helper tests --- lib/redmine/menu_manager/menu_helper.rb | 1 + .../lib/redmine/menu_manager/menu_helper_test.rb | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/redmine/menu_manager/menu_helper.rb b/lib/redmine/menu_manager/menu_helper.rb index 6204a53be2..30cd118188 100644 --- a/lib/redmine/menu_manager/menu_helper.rb +++ b/lib/redmine/menu_manager/menu_helper.rb @@ -14,6 +14,7 @@ module Redmine::MenuManager::MenuHelper include TopMenuHelper + include AccessibilityHelper # Returns the current menu item name def current_menu_item diff --git a/test/unit/lib/redmine/menu_manager/menu_helper_test.rb b/test/unit/lib/redmine/menu_manager/menu_helper_test.rb index cf153003b1..6d4496288f 100644 --- a/test/unit/lib/redmine/menu_manager/menu_helper_test.rb +++ b/test/unit/lib/redmine/menu_manager/menu_helper_test.rb @@ -59,14 +59,16 @@ class Redmine::MenuManager::MenuHelperTest < HelperTestCase node = Redmine::MenuManager::MenuItem.new(:testing, '/test', { }) @response.body = render_single_menu_node(node, 'This is a test', node.url, false) - assert_select("a.testing", "This is a test") + html_node = HTML::Document.new(@response.body) + assert_select(html_node.root, "a.testing", "This is a test") end def test_render_menu_node single_node = Redmine::MenuManager::MenuItem.new(:single_node, '/test', { }) @response.body = render_menu_node(single_node, nil) - assert_select("li") do + html_node = HTML::Document.new(@response.body) + assert_select(html_node.root, "li") do assert_select("a.single-node", "Single node") end end @@ -81,7 +83,8 @@ class Redmine::MenuManager::MenuHelperTest < HelperTestCase @response.body = render_menu_node(parent_node, nil) - assert_select("li") do + html_node = HTML::Document.new(@response.body) + assert_select(html_node.root, "li") do assert_select("a.parent-node", "Parent node") assert_select("ul") do assert_select("li a.child-one-node", "Child one node") @@ -115,7 +118,8 @@ class Redmine::MenuManager::MenuHelperTest < HelperTestCase }) @response.body = render_menu_node(parent_node, Project.find(1)) - assert_select("li") do + html_node = HTML::Document.new(@response.body) + assert_select(html_node.root, "li") do assert_select("a.parent-node", "Parent node") assert_select("ul") do assert_select("li a.test-child-0", "Test child 0") @@ -154,7 +158,8 @@ class Redmine::MenuManager::MenuHelperTest < HelperTestCase @response.body = render_menu_node(parent_node, Project.find(1)) - assert_select("li") do + html_node = HTML::Document.new(@response.body) + assert_select(html_node.root, "li") do assert_select("a.parent-node", "Parent node") assert_select("ul") do assert_select("li a.child-node", "Child node")