Sha256: fb407774eb844e01e07c018ca157c5403a7af797c3554b8af6221950847e81ba

Contents?: true

Size: 659 Bytes

Versions: 3

Compression:

Stored size: 659 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]) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pulitzer-0.1.10 spec/models/version_spec.rb
pulitzer-0.1.9 spec/models/version_spec.rb
pulitzer-0.1.8 spec/models/version_spec.rb