Sha256: 469172b524eb1501a1fcee8101a2ca0e00898a864b1686c1aea52c152e7a9f4a

Contents?: true

Size: 821 Bytes

Versions: 26

Compression:

Stored size: 821 Bytes

Contents

require 'test_helper'

module PushType
  class PresentableTest < ActiveSupport::TestCase

    class TestPage < PushType::Node
      field :location, :structure
    end

    describe 'class methods' do
      it { Page.presenter_class_name.must_equal 'PagePresenter' }
      it { Location.presenter_class_name.must_equal 'LocationPresenter' }
      it { Page.presenter_class.must_be_instance_of Class }
    end

    describe 'instance methods' do
      let(:page) { TestPage.new FactoryGirl.attributes_for(:node) }
      it { page.presenter_class.must_be_instance_of Class }
      it { page.location.presenter_class.must_be_instance_of Class }
      it { page.present!.class.ancestors.must_include PushType::Presenter }
      it { page.location.present!.class.ancestors.must_include PushType::Presenter }
    end

  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
push_type_core-0.8.0.beta.1 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.7.0 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.7.0.beta.1 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.6.0 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.6.0.beta.4 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.6.0.beta.3 test/models/concerns/push_type/presentable_test.rb