Skip to content

Commit

Permalink
Head document with meta specs [#42 state:open]
Browse files Browse the repository at this point in the history
  • Loading branch information
yrashk committed Apr 30, 2008
1 parent 36874a8 commit fe48df7
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions spec/lib/strokedb/document/document_spec.rb
Expand Up @@ -507,9 +507,52 @@
@document.some_indirect_link.first.should_not be_a_kind_of(VersionedDocument)
end

end

describe "Head Document with meta" do

before(:each) do
setup_default_store
Object.send!(:remove_const,'SomeMeta') if defined?(SomeMeta)
SomeMeta = Meta.new
@document = SomeMeta.create!
@document.should be_head
end

it "should link to head meta" do
Object.send!(:remove_const,'SomeMeta') if defined?(SomeMeta)
SomeMeta = Meta.new(:some_slot => 1)
pending("#42 bug to be actually fixed [NEEDS ATTENTION!!!]") do
@document.meta.should be_head
@document.meta.should_not be_a_kind_of(VersionedDocument)
@document.meta.some_slot.should == 1
end
end

end

describe "Non-head Document with meta" do

before(:each) do
setup_default_store
Object.send!(:remove_const,'SomeMeta') if defined?(SomeMeta)
SomeMeta = Meta.new
@document = SomeMeta.create!
@document.update_slots! :updated => true
@document = @document.versions.previous
@document.should_not be_head
end

it "should link to exact meta version" do
Object.send!(:remove_const,'SomeMeta') if defined?(SomeMeta)
SomeMeta = Meta.new(:some_slot => 1)

@document.meta.should_not be_head
@document.meta.should be_a_kind_of(VersionedDocument)
@document.meta.should_not have_slot(:some_slot)
end

end
describe "Saved VersionedDocument" do

before(:each) do
Expand Down

0 comments on commit fe48df7

Please sign in to comment.