Sha256: 4a8167fdaed330ed3a7be7bea222229effdc74011f268f4ed9905ea3f6ab0553
Contents?: true
Size: 1.08 KB
Versions: 8
Compression:
Stored size: 1.08 KB
Contents
require 'spec_helper' describe ManageableContent::PageContent do context "fields" do it { should have_db_column(:page_id).of_type(:integer) } it { should have_db_column(:key).of_type(:string) } it { should have_db_column(:content).of_type(:text) } it { should have_db_column(:short).of_type(:boolean) } it { should have_db_column(:created_at).of_type(:datetime) } it { should have_db_column(:updated_at).of_type(:datetime) } it { should have_db_index([:page_id, :key]).unique(true) } end context "mass assignment" do it { should allow_mass_assignment_of(:content) } it { should_not allow_mass_assignment_of(:key) } it { should_not allow_mass_assignment_of(:page_id) } it { should_not allow_mass_assignment_of(:short) } it { should_not allow_mass_assignment_of(:updated_at) } it { should_not allow_mass_assignment_of(:created_at) } end context "validations" do it { should validate_presence_of(:page_id) } it { should validate_presence_of(:key) } end context "associations" do it { should belong_to :page } end end
Version data entries
8 entries across 8 versions & 1 rubygems