test/unit/test_page.rb in spontaneous-0.2.0.alpha7 vs test/unit/test_page.rb in spontaneous-0.2.0.beta1

- old
+ new

@@ -2,35 +2,27 @@ require File.expand_path('../../test_helper', __FILE__) class PageTest < MiniTest::Spec - include Spontaneous def setup @site = setup_site end def teardown teardown_site end - context "All pages" do - # should "have a pre-defined 'title' field" do - # p = Page.new - # p.field?(:title).should be_true - # p.title.value.should == "New Page" - # end - end context "Pages:" do setup do Content.delete - class Page < Spot::Page + class Page < ::Page field :title, :string box :sub end - class Piece < Spontaneous::Piece; end + class Piece < ::Piece; end end teardown do PageTest.send(:remove_const, :Page) PageTest.send(:remove_const, :Piece) end @@ -182,9 +174,14 @@ @q.page.should == @q @r.page.should == @r @s.page.should == @s @t.page.should == @t end + + should "have a reference to themselves as content_instance" do + @p.content_instance.should == @p + end + should "keep track of their depth" do @p.depth.should == 0 @q.depth.should == 1 @r.depth.should == 2 @s.depth.should == 2