Sha256: 3ac6741f5ad3d981cad465d4a7f9f4a25deb55e3f75a129862ae47f03fb8fe08

Contents?: true

Size: 789 Bytes

Versions: 34

Compression:

Stored size: 789 Bytes

Contents

require 'test_helper'

module PushType
  class PresenterTest < ActiveSupport::TestCase

    let(:page) { Page.create FactoryGirl.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

34 entries across 34 versions & 1 rubygems

Version Path
push_type_core-0.11.2 test/lib/push_type/presenter_test.rb
push_type_core-0.11.1 test/lib/push_type/presenter_test.rb
push_type_core-0.11.0.beta.2 test/lib/push_type/presenter_test.rb
push_type_core-0.11.0.beta.1 test/lib/push_type/presenter_test.rb
push_type_core-0.10.4 test/lib/push_type/presenter_test.rb
push_type_core-0.10.3 test/lib/push_type/presenter_test.rb
push_type_core-0.10.2 test/lib/push_type/presenter_test.rb
push_type_core-0.10.1 test/lib/push_type/presenter_test.rb
push_type_core-0.10.0 test/lib/push_type/presenter_test.rb
push_type_core-0.10.0.beta.5 test/lib/push_type/presenter_test.rb
push_type_core-0.10.0.beta.3 test/lib/push_type/presenter_test.rb
push_type_core-0.9.5 test/lib/push_type/presenter_test.rb
push_type_core-0.9.3 test/lib/push_type/presenter_test.rb
push_type_core-0.9.2 test/lib/push_type/presenter_test.rb
push_type_core-0.9.1 test/lib/push_type/presenter_test.rb
push_type_core-0.9.0 test/lib/push_type/presenter_test.rb
push_type_core-0.9.0.beta.4 test/lib/push_type/presenter_test.rb
push_type_core-0.9.0.beta.3 test/lib/push_type/presenter_test.rb
push_type_core-0.9.0.beta.2 test/lib/push_type/presenter_test.rb
push_type_core-0.8.2 test/lib/push_type/presenter_test.rb