Sha256: 98438254933f1ca61bdd72d0c36ad05b0af01ef0ba5ebd1805e45f41245de7f6

Contents?: true

Size: 672 Bytes

Versions: 3

Compression:

Stored size: 672 Bytes

Contents

require 'rails_helper'

describe Pulitzer::Version do
  let(:version) { build :version }

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

  describe "Active Model validations" do
    it { should validate_presence_of(:status) }
    it { should validate_presence_of(:post_id) }
  end

  describe "ActiveRecord associations" do
    it { should have_many(:content_elements).dependent(:destroy) }
    it { should have_many(:post_tags).dependent(:destroy) }
    it { should belong_to(:post) }
  end

  describe 'ActiveRecord enums' do
    it { should define_enum_for(:status).
      with([:preview, :active, :archived, :abandoned, :processing]) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pulitzer-0.2.2 spec/models/version_spec.rb
pulitzer-0.2.1 spec/models/version_spec.rb
pulitzer-0.2.0 spec/models/version_spec.rb