Adds tests for Redmine::MenuManager.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11205 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-01-20 10:59:53 +00:00
parent 1188789e15
commit 26016cdc08
1 changed files with 10 additions and 4 deletions

View File

@ -18,11 +18,17 @@
require File.expand_path('../../../../test_helper', __FILE__) require File.expand_path('../../../../test_helper', __FILE__)
class Redmine::MenuManagerTest < ActiveSupport::TestCase class Redmine::MenuManagerTest < ActiveSupport::TestCase
context "MenuManager#map" do def test_map_should_yield_a_mapper
should "be tested" 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 end
context "MenuManager#items" do def test_items_should_return_menu_items
should "be tested" items = Redmine::MenuManager.items(:project_menu)
assert_kind_of Redmine::MenuManager::MenuNode, items.first
end end
end end