Sha256: f261f0f31b9709ae8762e6110338f37d0f9f3a52912aa6d46487bcce51a88710

Contents?: true

Size: 955 Bytes

Versions: 19

Compression:

Stored size: 955 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe ArchivePage do
  dataset :archive
  
  before :each do
    @page = pages(:archive)
  end
  
  it "should scope child URLs by date" do
    pages(:article_1).url.should == '/archive/2000/01/01/article-1/'
  end
  
  it "should scope unpublished children by the current date" do
    pages(:draft_article).url.should == '/archive/' + Time.now.strftime('%Y/%m/%d') + '/draft-article/'
  end
  
  it "should find the year index" do
    @page.find_by_url('/archive/2000/').should == pages(:year_index)
  end
  
  it "should find the month index" do
    @page.find_by_url('/archive/2000/06/').should == pages(:month_index)
  end
  
  it "should find the day index" do
    @page.find_by_url('/archive/2000/06/09/').should == pages(:day_index)
  end
  
  it "should find child URLs from the homepage" do
    pages(:home).find_by_url('/archive/2000/01/01/article-1/').should == pages(:article_1)
  end
end

Version data entries

19 entries across 19 versions & 3 rubygems

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