Sha256: 4610b527a02069ab8cc18b71b05ad9ae19951950d8ccebb8bae9203315d095b9

Contents?: true

Size: 1.3 KB

Versions: 9

Compression:

Stored size: 1.3 KB

Contents

# encoding: UTF-8
require "spec_helper"

describe Mango::ContentPage do

  #################################################################################################

  describe "class constants" do
    it "defines CONTENT_ENGINES" do
      Mango::ContentPage::CONTENT_ENGINES.should have(2).item
      Mango::ContentPage::CONTENT_ENGINES.should include(:haml => ["haml"])
      Mango::ContentPage::CONTENT_ENGINES.should include(:markdown => ["md", "mdown", "markdown"])
    end

    it "defines DEFAULT" do
      Mango::ContentPage::DEFAULT.should have(3).items
      Mango::ContentPage::DEFAULT.should include(:body => "")
      Mango::ContentPage::DEFAULT.should include(:content_engine => :markdown)

      attributes = Mango::ContentPage::DEFAULT[:attributes]
      attributes.should include("view" => :page)
    end
  end

  #################################################################################################

  describe "attribute syntactic sugar" do
    before(:all) do
      @page = Mango::ContentPage.new <<-EOS
---
title: Syntactic Sugar Makes Life Sweeter
---
EOS
    end

    it "makes the title sweeter" do
      @page.title.should == @page.attributes["title"]
    end
    it "doesn't make unknown sweeter" do
      lambda { @page.unknown }.should raise_exception(NoMethodError)
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mango-0.5.4 spec/lib/content_page_spec.rb
mango-0.5.3 spec/lib/content_page_spec.rb
mango-0.5.2 spec/lib/content_page_spec.rb
mango-0.5.1 spec/lib/content_page_spec.rb
mango-0.5.0 spec/lib/content_page_spec.rb
mango-0.5.0.beta5 spec/mango/content_page_spec.rb
mango-0.5.0.beta4 spec/mango/content_page_spec.rb
mango-0.5.0.beta3 spec/mango/content_page_spec.rb
mango-0.5.0.beta2 spec/mango/content_page_spec.rb