Sha256: a44d8c0a8123facf28769cfd91e95fe669a7ef8c87dead11a09c1fd9c93b4c57

Contents?: true

Size: 1.1 KB

Versions: 17

Compression:

Stored size: 1.1 KB

Contents

require_relative '../../app/presenters/menu_section_presenter'
require_relative '../../app/presenters/menu_link_presenter'
require_relative '../../app/presenters/theme_presentation'

describe MenuSectionPresenter do
  describe "#name" do
    describe "when name is not defined" do
      subject { ThemePresentation.wrap(stub, MenuSectionPresenter) }

      it "does not yield the name" do
        called = false
        subject.name { called = true }
        called.should == false
      end
    end

    describe "when name is present" do
      subject { ThemePresentation.wrap(stub(name:'Bob'), MenuSectionPresenter) }

      it "yields the name" do
        called = false
        subject.name { |name|
          name.should == 'Bob'
          called = true
        }

        called.should == true
      end
    end
  end

  describe "#links" do
    it "wraps each link in a MenuLinkPresenter" do
      section = ThemePresentation.wrap(stub(name: 'Bob', links: [stub, stub, stub]), MenuSectionPresenter)

      section.links.each do |link|
        link.wrapped_by.should == [MenuLinkPresenter]
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
woople-theme-0.8.2 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.8.1 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.8.0 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.27 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.26 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.25 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.24 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.23 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.22 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.21 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.20 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.19 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.18 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.17 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.14 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.13 spec/presenters/menu_section_presenter_spec.rb
woople-theme-0.6.12 spec/presenters/menu_section_presenter_spec.rb