Sha256: 86abbaae294280930a32e5421a54f2cd486b36d78de86ec60dec5030ce37d79f

Contents?: true

Size: 992 Bytes

Versions: 1

Compression:

Stored size: 992 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class MenuHelperTest < Test::Unit::TestCase
  include PluginAWeek::Helpers::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" id="menubar">
  <li id="home"><a href="http://test.host/">Home</a>
    <ul id="home_menubar">
      <li id="browse"><a href="http://test.host/home/browse">Browse</a></li>
      <li class="last" id="search"><a href="http://test.host/search_stuff">Search</a></li>
    </ul>
  </li>
  <li class="selected" id="contact"><a href="http://test.host/contact">Contact Us</a></li>
  <li class="last" id="about_us"><a href="http://test.host/about_us">About Us</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.0.1 test/unit/menu_helper_test.rb