Sha256: 7a1e0dc3c9ca437fd99f4d00db06f83fda5ffc7bbe4c1d6c6979fc127e266df6

Contents?: true

Size: 1.32 KB

Versions: 18

Compression:

Stored size: 1.32 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!(:website) { FactoryGirl.create(:website, :name => "Website")}
  let(:page) { FactoryGirl.create(:website_section,:website => website) }
  let(:blog) { FactoryGirl.create(:blog,:website => website) }
  let(:document) { FactoryGirl.create(:online_document_section,:website => website) }
  
  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

18 entries across 18 versions & 1 rubygems

Version Path
knitkit-3.2.0 spec/models/website_section_spec.rb
knitkit-3.0.0 spec/models/website_section_spec.rb
knitkit-2.1.15 spec/models/website_section_spec.rb
knitkit-2.1.14 spec/models/website_section_spec.rb
knitkit-2.1.13 spec/models/website_section_spec.rb
knitkit-2.1.12 spec/models/website_section_spec.rb
knitkit-2.1.11 spec/models/website_section_spec.rb
knitkit-2.1.10 spec/models/website_section_spec.rb
knitkit-2.1.9 spec/models/website_section_spec.rb
knitkit-2.1.8 spec/models/website_section_spec.rb
knitkit-2.1.7 spec/models/website_section_spec.rb
knitkit-2.1.6 spec/models/website_section_spec.rb
knitkit-2.1.5 spec/models/website_section_spec.rb
knitkit-2.1.4 spec/models/website_section_spec.rb
knitkit-2.1.3 spec/models/website_section_spec.rb
knitkit-2.1.2 spec/models/website_section_spec.rb
knitkit-2.1.1 spec/models/website_section_spec.rb
knitkit-2.1.0 spec/models/website_section_spec.rb