Sha256: 07b89eca154a37400a478db64dcbe1a57fc845ba9279f78f3a86f96e1b57f422

Contents?: true

Size: 1.18 KB

Versions: 10

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'

describe WebsiteSection do
  it "can be instantiated" do
    WebsiteSection.new.should be_an_instance_of(WebsiteSection)
  end

  it "can be saved successfully" do
    WebsiteSection.create(:title => "Some Title").should be_persisted
  end
end

describe WebsiteSection, "is_section? and is_document_section?" do
  let(:page) { Factory.create(:website_section) }
  let(:blog) { Factory.create(:blog) }
  let(:document) { Factory.create(:online_document_section) }
  
  describe WebsiteSection, "is_section?" do
    it "should return true for the page" do
      page.is_section?.should be_true
    end

    it "should return true for the blog" do
      blog.is_section?.should be_true
    end

    it "should return false for the document" do
      document.is_section?.should be_false
    end
  end
  
  describe WebsiteSection, "is_document_section?" do  
    it "should return true for the page" do
      page.is_document_section?.should be_false
    end

    it "should return true for the blog" do
      blog.is_document_section?.should be_false
    end

    it "should return false for the document" do
      document.is_document_section?.should be_true
    end
  end
  
  
end


Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
knitkit-2.0.11 spec/models/website_section_spec.rb
knitkit-2.0.10 spec/models/website_section_spec.rb
knitkit-2.0.9 spec/models/website_section_spec.rb
knitkit-2.0.7 spec/models/website_section_spec.rb
knitkit-2.0.6 spec/models/website_section_spec.rb
knitkit-2.0.5 spec/models/website_section_spec.rb
knitkit-2.0.4 spec/models/website_section_spec.rb
knitkit-2.0.3 spec/models/website_section_spec.rb
knitkit-2.0.2 spec/models/website_section_spec.rb
knitkit-2.0.1 spec/models/website_section_spec.rb