Sha256: 811a78eef797b8b1110b7c7a2659961bde389c5727d8013cd07cf73234cf2a3c

Contents?: true

Size: 768 Bytes

Versions: 8

Compression:

Stored size: 768 Bytes

Contents

require 'spec_helper'

describe SpudMenuItem do

  it {should have_many(:spud_menu_items)}
  it {should belong_to(:spud_page)}
  it {should belong_to(:spud_menu)}
  it {should belong_to(:parent)}

  describe :validations do
    it "should require a name" do
      p = Factory.build(:spud_menu_item,:name => nil)
      p.should_not be_valid
    end

    it "should require a menu_id" do
      p = Factory.build(:spud_menu_item,:spud_menu_id => nil)
      p.should_not be_valid
    end

    it "should require a parent_type" do
      p = Factory.build(:spud_menu_item,:parent_type => nil)
      p.should_not be_valid
    end

    it "should require a parent_id" do
      p = Factory.build(:spud_menu_item,:parent_id => nil)
      p.should_not be_valid
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
spud_cms-0.9.7 spec/models/spud_menu_item_spec.rb
spud_cms-0.9.6 spec/models/spud_menu_item_spec.rb
spud_cms-0.9.5 spec/models/spud_menu_item_spec.rb
spud_cms-0.9.4 spec/models/spud_menu_item_spec.rb
spud_cms-0.9.3 spec/models/spud_menu_item_spec.rb
spud_cms-0.9.2 spec/models/spud_menu_item_spec.rb
spud_cms-0.9.1 spec/models/spud_menu_item_spec.rb
spud_cms-0.9.0 spec/models/spud_menu_item_spec.rb