Sha256: 90e6e76bf44ad0db84b82ef677de68d58a3cf625299687b775c5ca561d69abb0

Contents?: true

Size: 826 Bytes

Versions: 119

Compression:

Stored size: 826 Bytes

Contents

describe AmaLayout::NavigationItem do
  let(:site_domain) { "http://waffleemporium.ca" }

  describe "#initialize" do
    it "returns a navigation item" do
      params = { text: "Gotham Overview", icon: "fa-tachometer", link: "#{site_domain}/gotica", alt: "Back to my dashboard", current_url: "#{site_domain}" }
      expect(AmaLayout::NavigationItem.new(params)).to be_a AmaLayout::NavigationItem
    end
  end

  describe "#sub_nav" do
    it "set the subnav" do
      subject.current_url = "#{site_domain}"
      items = [{ text: "Othersite Overview", link: "#{site_domain}/othersite"}]
      subject.sub_nav = items
      expect(subject.sub_nav).to be_an Array
      expect(subject.sub_nav.first.link).to include items.first[:link]
      expect(subject.sub_nav.first.text).to include items.first[:text]
    end
  end
end

Version data entries

119 entries across 119 versions & 1 rubygems

Version Path
ama_layout-8.0.2 spec/ama_layout/navigation_item_spec.rb
ama_layout-8.0.1 spec/ama_layout/navigation_item_spec.rb
ama_layout-8.0.0 spec/ama_layout/navigation_item_spec.rb
ama_layout-7.0.2 spec/ama_layout/navigation_item_spec.rb
ama_layout-7.0.1 spec/ama_layout/navigation_item_spec.rb
ama_layout-5.12.0 spec/ama_layout/navigation_item_spec.rb
ama_layout-7.0.pre spec/ama_layout/navigation_item_spec.rb
ama_layout-5.11.0 spec/ama_layout/navigation_item_spec.rb
ama_layout-6.10.0.pre spec/ama_layout/navigation_item_spec.rb
ama_layout-5.10.0 spec/ama_layout/navigation_item_spec.rb
ama_layout-5.9.0 spec/ama_layout/navigation_item_spec.rb
ama_layout-5.8.0 spec/ama_layout/navigation_item_spec.rb
ama_layout-5.7.0 spec/ama_layout/navigation_item_spec.rb
ama_layout-5.6.0 spec/ama_layout/navigation_item_spec.rb
ama_layout-5.5.0 spec/ama_layout/navigation_item_spec.rb
ama_layout-5.4.0 spec/ama_layout/navigation_item_spec.rb
ama_layout-6.3.0.pre spec/ama_layout/navigation_item_spec.rb
ama_layout-5.2.0 spec/ama_layout/navigation_item_spec.rb
ama_layout-5.1.1 spec/ama_layout/navigation_item_spec.rb
ama_layout-5.1.0 spec/ama_layout/navigation_item_spec.rb