Sha256: b0a710c62ef8196a96355a61397578f5022216ac49a089d08c0bd9ffcb752ca8

Contents?: true

Size: 697 Bytes

Versions: 36

Compression:

Stored size: 697 Bytes

Contents

require 'spec_helper'

describe WoopleTheme::Dashboard::SectionPresenter do
  describe '#render' do
    describe 'when section is enabled' do
      let(:data) { stub_presenter }

      subject { WoopleTheme::Dashboard::SectionPresenter.new(data) }

      specify { expect { |b| subject.render(&b) }.to yield_control }
    end

    describe 'when section is not enabled' do
      let(:data) { stub_presenter(false) }

      subject { WoopleTheme::Dashboard::SectionPresenter.new(data) }

      specify { expect { |b| subject.render(&b) }.not_to yield_control }
    end
  end

  private

  def stub_presenter(enable=true)
    stub({title:'section title', enabled?: enable}).as_null_object
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
woople-theme-0.10.0 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.9.0 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.19 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.18 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.17 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.16 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.15 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.14 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.13 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.12 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.11 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.10 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.9 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.8 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.7 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.6 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.5 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.4 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.3 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb
woople-theme-0.8.2 spec/presenters/woople_theme/dashboard/section_presenter_spec.rb