Sha256: baa752afc32657a28d23e9ebad6ff3ff1afb318bd95867c781dc3a2de61d0618

Contents?: true

Size: 708 Bytes

Versions: 53

Compression:

Stored size: 708 Bytes

Contents

require 'rails_helper'

describe Pulitzer::PostType do
  let(:post_type) { build :post_type }

  it 'has a valid factory' do
    expect(post_type).to be_valid
  end

  describe "Active Model validations" do
    it { should validate_presence_of(:name) }
    it { should validate_presence_of(:kind) }
  end

  describe "ActiveRecord associations" do
    it { should have_many(:posts).dependent(:destroy) }
    it { should have_many(:post_type_content_element_types).dependent(:destroy) }
    it { should have_many(:content_element_types).through(:post_type_content_element_types) }
  end

  describe 'ActiveRecord enums' do
    it { should define_enum_for(:kind).
      with([:template, :partial]) }
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
pulitzer-0.15.0 spec/models/post_type_spec.rb
pulitzer-0.14.4 spec/models/post_type_spec.rb
pulitzer-0.14.3 spec/models/post_type_spec.rb
pulitzer-0.14.2 spec/models/post_type_spec.rb
pulitzer-0.14.1 spec/models/post_type_spec.rb
pulitzer-0.14.0 spec/models/post_type_spec.rb
pulitzer-0.13.1 spec/models/post_type_spec.rb
pulitzer-0.12.5 spec/models/post_type_spec.rb
pulitzer-0.13.0 spec/models/post_type_spec.rb
pulitzer-0.12.4 spec/models/post_type_spec.rb
pulitzer-0.12.3 spec/models/post_type_spec.rb
pulitzer-0.12.2 spec/models/post_type_spec.rb
pulitzer-0.12.1 spec/models/post_type_spec.rb
pulitzer-0.12.0 spec/models/post_type_spec.rb
pulitzer-0.11.3 spec/models/post_type_spec.rb
pulitzer-0.11.2 spec/models/post_type_spec.rb
pulitzer-0.11.1 spec/models/post_type_spec.rb
pulitzer-0.11.0 spec/models/post_type_spec.rb
pulitzer-0.10.3 spec/models/post_type_spec.rb
pulitzer-0.10.2 spec/models/post_type_spec.rb