Sha256: 907b34e79921812492fd2d1fb4a60c2a2bee660a9c55e5396fd756aa2d4c71b6
Contents?: true
Size: 1.04 KB
Versions: 47
Compression:
Stored size: 1.04 KB
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, :processing_failed]) } end describe 'post tag filters' do it "has post tag filter methods" do label = create :tag version.save version.post_tags.create label: label expect(version.has_label_type(label.class.name)).to be true expect(version.has_label(label)).to be true expect(version.post_tags_for(label.class.name).map(&:label)).to include label end end end
Version data entries
47 entries across 47 versions & 1 rubygems