Sha256: b500f3bc3a5d397cc6458488c6ca63c284d1b3952b3d8c62cae128eb41d7c42d

Contents?: true

Size: 719 Bytes

Versions: 16

Compression:

Stored size: 719 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, :free_form, :hybrid]) }
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
pulitzer-0.3.9 spec/models/post_type_spec.rb
pulitzer-0.3.8 spec/models/post_type_spec.rb
pulitzer-0.3.7 spec/models/post_type_spec.rb
pulitzer-0.3.6 spec/models/post_type_spec.rb
pulitzer-0.3.5 spec/models/post_type_spec.rb
pulitzer-0.3.4 spec/models/post_type_spec.rb
pulitzer-0.3.3 spec/models/post_type_spec.rb
pulitzer-0.3.2 spec/models/post_type_spec.rb
pulitzer-0.3.1 spec/models/post_type_spec.rb
pulitzer-0.3.0 spec/models/post_type_spec.rb
pulitzer-0.2.2 spec/models/post_type_spec.rb
pulitzer-0.2.1 spec/models/post_type_spec.rb
pulitzer-0.2.0 spec/models/post_type_spec.rb
pulitzer-0.1.10 spec/models/post_type_spec.rb
pulitzer-0.1.9 spec/models/post_type_spec.rb
pulitzer-0.1.8 spec/models/post_type_spec.rb