Sha256: 7c2c33c479948cdcd4515d3389039cf8da1d527d2ee0ec73649b42480355c34d

Contents?: true

Size: 688 Bytes

Versions: 1

Compression:

Stored size: 688 Bytes

Contents

require 'spec_helper'

describe Site do
  before do
    @site = Site.make
    @first_page = @site.pages.make(:title => 'home')
    @second_page = @site.pages.make(:title => 'about us')
  end

  it "has a homepage" do
    @site.homepage.should be_a(Page)
  end
  
  it "marks the first page as homepage" do
    @site.homepage.should == @first_page
  end
  
  it "has many pages" do
    @site.pages.count.should == 2
  end
  
  it "has many articles" do
    @post_1 = @site.articles.make(:title => "first post")
    @post_2 = @site.articles.make(:title => "second post")
    
    @site.should have(2).articles
  end
  
  it "finds pages by url" do
    @site.pages.find_by_url("")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
content_engine-0.1.0 spec/models/site_spec.rb