Sha256: 9ba2f1ba50eeb56faa6b786901e5f0bcedf2bdc7e8a34bd67f057fb920181711

Contents?: true

Size: 765 Bytes

Versions: 10

Compression:

Stored size: 765 Bytes

Contents

require "test_helper"

module PushType
  describe Presenter do

    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

10 entries across 10 versions & 1 rubygems

Version Path
push_type_core-0.5.1 test/lib/push_type/presenter_test.rb
push_type_core-0.5.0 test/lib/push_type/presenter_test.rb
push_type_core-0.5.0.alpha.5 test/lib/push_type/presenter_test.rb
push_type_core-0.5.0.alpha.4 test/lib/push_type/presenter_test.rb
push_type_core-0.5.0.alpha.3 test/lib/push_type/presenter_test.rb
push_type_core-0.5.0.alpha.2 test/lib/push_type/presenter_test.rb
push_type_core-0.5.0.alpha.1 test/lib/push_type/presenter_test.rb
push_type_core-0.4.0 test/lib/push_type/presenter_test.rb
push_type_core-0.4.0.beta.3 test/lib/push_type/presenter_test.rb
push_type_core-0.3.3 test/lib/push_type/presenter_test.rb