Sha256: 513ba19d40d073be171c4daa3e2a377ade05d794f665febfd7e1272ac153ecf9
Contents?: true
Size: 1.09 KB
Versions: 11
Compression:
Stored size: 1.09 KB
Contents
require "test_helper" module PushType module MenuBuilder describe MenuItem do let(:item) { MenuBuilder::MenuItem.new :foo } it { item.key.must_equal :foo } it { item.text.must_equal 'Foo' } it { item.link.must_equal nil } it { item.active.must_equal false } it { item.element.must_equal :li } it { item.item_options.must_be_instance_of Hash } it { item.link_options.must_be_instance_of Hash } it { item.active_class.must_equal nil } describe '#submenu' do it 'should create a new menu' do item.submenu.must_be_instance_of MenuBuilder::Menu end it 'should use existing submenu if present' do menu = item.submenu item.submenu.must_equal menu end end describe '#validate!' do describe 'without all attributes' do it { proc { item.validate! }.must_raise RuntimeError } end describe 'with all attributes' do before { item.link = '/foobar' } it { item.validate!.must_equal true } end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems