Sha256: e4f5edec9d3a74c4e5c2ff94309c69238eb2f10dec8a26fdd3b718bd65ed874a
Contents?: true
Size: 1.01 KB
Versions: 1
Compression:
Stored size: 1.01 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../test_helper') class MenuHelperTest < ActionView::TestCase tests PluginAWeek::MenuHelper def test_should_build_menu_bar menu_bar_html = menu_bar({}, :class => 'pretty') do |main| main.menu :home do |home| home.menu :browse home.menu :search end main.menu :contact, 'Contact Us' main.menu :about_us end expected = <<-eos <ul class="pretty menubar menubar-1"> <li><a href="http://test.host/home"><span>Home</span></a> <ul class="menubar menubar-2"> <li><a href="http://test.host/home/browse"><span>Browse</span></a></li> <li class="menubar-last"><a href="http://test.host/home/search"><span>Search</span></a></li> </ul> </li> <li class="menubar-selected"><a href="http://test.host/contact"><span>Contact Us</span></a></li> <li class="menubar-last"><a href="http://test.host/about_us"><span>About Us</span></a></li> </ul> eos assert_equal expected.gsub(/\n\s*/, ''), menu_bar_html end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
menu_helper-0.1.0 | test/helpers/menu_helper_test.rb |