Sha256: c2dc4a8b93fff53574f4c63ebc24283b6b909438814970b43ca1c4bf1d53e569

Contents?: true

Size: 2 KB

Versions: 19

Compression:

Stored size: 2 KB

Contents

class ArchiveDataset < Dataset::Base
  uses :home_page
  
  def load
    create_page "Archive", :class_name => "ArchivePage" do
      create_page "Year Index", :class_name => "ArchiveYearIndexPage", :title => "%Y Archive"
      create_page "Month Index", :class_name => "ArchiveMonthIndexPage", :title => "%B %Y Archive"
      create_page "Day Index", :class_name => "ArchiveDayIndexPage", :title => "%B %d, %Y Archive"
      (1..5).each do |i|
        create_page "Article #{i}", :published_at => Time.local(1999+i, i, i).to_s(:db)
      end
      create_page "Draft Article", :status_id => Status[:draft].id, :published_at => nil
    end
  end
  
  helpers do
    describe "Archive index page", :shared => true do
      it "should be virtual" do
        @page.should be_virtual
      end
      
      it "should render <r:archive:children:first /> as unimplemented" do
        @page.should render('<r:archive:children:first><r:slug /></r:archive:children:first>').as('unimplemented')
      end

      it "should render <r:archive:children:last /> as unimplemented" do
        @page.should render('<r:archive:children:last><r:slug /></r:archive:children:last>').as('unimplemented')
      end

      it "should <r:archive:children:count /> as unimplemented" do
        @page.should render('<r:archive:children:count><r:slug /></r:archive:children:count>').as('unimplemented')
      end
      
      it "should render the <r:archive:year /> tag" do
        @page.should render("<r:archive:year />").as("2000").on("/archive/2000/")
      end
      
      it "should render the <r:archive:month /> tag" do
        @page.should render("<r:archive:month />").as("June").on("/archive/2000/06/")
      end
      
      it "should render the <r:archive:day /> tag" do
        @page.should render('<r:archive:day />').as("9").on('/archive/2000/06/09/')
      end
      
      it "should render the <r:archive:day_of_week /> tag" do
        @page.should render('<r:archive:day_of_week />').as('Friday').on("/archive/2000/06/09/")
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

Version Path
radiantcms-couchrest_model-0.2.4 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiantcms-couchrest_model-0.2.2 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiantcms-couchrest_model-0.2.1 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiantcms-couchrest_model-0.2 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiantcms-couchrest_model-0.1.9 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiantcms-couchrest_model-0.1.8 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiantcms-couchrest_model-0.1.7 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiantcms-couchrest_model-0.1.6 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiantcms-couchrest_model-0.1.5 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiantcms-couchrest_model-0.1.4 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiant-0.7.2 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiant-0.9.1 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiant-0.8.2 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiant-0.9.0.rc2 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiant-rc-0.9.0 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiant-0.8.1 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiant-0.7.0 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiant-0.8.0 vendor/extensions/archive/spec/datasets/archive_dataset.rb
radiant-0.7.1 vendor/extensions/archive/spec/datasets/archive_dataset.rb