Sha256: a8ef65696d0ab36af7633feaa88c34d20ee87ff78122d057843bc44796e3f0cf

Contents?: true

Size: 788 Bytes

Versions: 3

Compression:

Stored size: 788 Bytes

Contents

require 'test_helper'

module PushType
  class PresenterTest < ActiveSupport::TestCase

    let(:page) { Page.create FactoryBot.attributes_for(:node) }

    describe 'without view context' do
      let(:presenter) { PushType::Presenter.new page }
      it { presenter.must_be_instance_of Page }
      it { presenter.class.ancestors.must_include PushType::Presenter }
      it { presenter.model.must_equal page }
      it { presenter.title.must_equal page.title }
      it { proc { presenter.helpers }.must_raise RuntimeError }
    end

    describe 'with view context' do
      let(:view_context) { ApplicationController.new.view_context }
      let(:presenter) { PushType::Presenter.new page, view_context }
      it { presenter.helpers.must_respond_to :content_tag }
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
push_type_core-0.12.1 test/lib/push_type/presenter_test.rb
push_type_core-0.12.0 test/lib/push_type/presenter_test.rb
push_type_core-0.12.0.beta.1 test/lib/push_type/presenter_test.rb