Sha256: 297530d24d5aaa7086012a96d5574a69305fa3d443b7dbf60cb15003067a0ebf
Contents?: true
Size: 1.06 KB
Versions: 37
Compression:
Stored size: 1.06 KB
Contents
require 'test_helper' module PushType module MenuBuilder class Dsl::MenuItemTest < ActiveSupport::TestCase let(:item) { MenuBuilder::MenuItem.new(:bar) } describe '.build' do before do MenuBuilder::Dsl::MenuItem.build(item) do text 'FooBar' link '/foobar' active { 1 == 1 } element :div item_options class: 'foo-bar', data: { foo: 'bar' } link_options class: 'foo-baz', data: { foo: 'baz' } active_class 'foo-active' end end it { item.text.must_equal 'FooBar' } it { item.link.must_equal '/foobar' } it { item.active.call.must_equal true } it { item.element.must_equal :div } it { item.item_options[:class].must_equal 'foo-bar' } it { item.item_options[:data][:foo].must_equal 'bar' } it { item.link_options[:class].must_equal 'foo-baz' } it { item.link_options[:data][:foo].must_equal 'baz' } it { item.active_class.must_equal 'foo-active' } end end end end
Version data entries
37 entries across 37 versions & 1 rubygems