From 26016cdc086ad61075512414e72b3f3b9b6d8069 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 20 Jan 2013 10:59:53 +0000 Subject: [PATCH] Adds tests for Redmine::MenuManager. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11205 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/lib/redmine/menu_manager_test.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/unit/lib/redmine/menu_manager_test.rb b/test/unit/lib/redmine/menu_manager_test.rb index bb3d659bc..658340739 100644 --- a/test/unit/lib/redmine/menu_manager_test.rb +++ b/test/unit/lib/redmine/menu_manager_test.rb @@ -18,11 +18,17 @@ require File.expand_path('../../../../test_helper', __FILE__) class Redmine::MenuManagerTest < ActiveSupport::TestCase - context "MenuManager#map" do - should "be tested" + def test_map_should_yield_a_mapper + assert_difference 'Redmine::MenuManager.items(:project_menu).size' do + Redmine::MenuManager.map :project_menu do |mapper| + assert_kind_of Redmine::MenuManager::Mapper, mapper + mapper.push :new_item, '/' + end + end end - context "MenuManager#items" do - should "be tested" + def test_items_should_return_menu_items + items = Redmine::MenuManager.items(:project_menu) + assert_kind_of Redmine::MenuManager::MenuNode, items.first end end