class ArchiveScenario < Scenario::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 as unimplemented" do
@page.should render('').as('unimplemented')
end
it "should render as unimplemented" do
@page.should render('').as('unimplemented')
end
it "should as unimplemented" do
@page.should render('').as('unimplemented')
end
it "should render the tag" do
@page.should render("").as("2000").on("/archive/2000/")
end
it "should render the tag" do
@page.should render("").as("June").on("/archive/2000/06/")
end
it "should render the tag" do
@page.should render('').as("9").on('/archive/2000/06/09/')
end
it "should render the tag" do
@page.should render('').as('Friday').on("/archive/2000/06/09/")
end
end
end
end