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.10.4 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.10.3 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.10.2 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.10.1 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.10.0 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.10.0.beta.5 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.10.0.beta.3 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.9.5 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.9.3 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.9.2 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.9.1 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.9.0 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.9.0.beta.4 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.9.0.beta.3 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.9.0.beta.2 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.8.2 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.8.1 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.8.0 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.8.0.beta.3 test/models/concerns/push_type/presentable_test.rb
push_type_core-0.8.0.beta.2 test/models/concerns/push_type/presentable_test.rb