Commit fe48df76ca3d01f8e7b71a1c9fa8f5c675aacaea

Head document with meta specs [#42 state:open]

Commit diff

spec/lib/strokedb/document/document_spec.rb

 
507507 @document.some_indirect_link.first.should_not be_a_kind_of(VersionedDocument)
508508 end
509509
510end
511
512describe "Head Document with meta" do
513
514 before(:each) do
515 setup_default_store
516 Object.send!(:remove_const,'SomeMeta') if defined?(SomeMeta)
517 SomeMeta = Meta.new
518 @document = SomeMeta.create!
519 @document.should be_head
520 end
510521
522 it "should link to head meta" do
523 Object.send!(:remove_const,'SomeMeta') if defined?(SomeMeta)
524 SomeMeta = Meta.new(:some_slot => 1)
525 pending("#42 bug to be actually fixed [NEEDS ATTENTION!!!]") do
526 @document.meta.should be_head
527 @document.meta.should_not be_a_kind_of(VersionedDocument)
528 @document.meta.some_slot.should == 1
529 end
530 end
531
511532end
512533
534describe "Non-head Document with meta" do
535
536 before(:each) do
537 setup_default_store
538 Object.send!(:remove_const,'SomeMeta') if defined?(SomeMeta)
539 SomeMeta = Meta.new
540 @document = SomeMeta.create!
541 @document.update_slots! :updated => true
542 @document = @document.versions.previous
543 @document.should_not be_head
544 end
545
546 it "should link to exact meta version" do
547 Object.send!(:remove_const,'SomeMeta') if defined?(SomeMeta)
548 SomeMeta = Meta.new(:some_slot => 1)
549
550 @document.meta.should_not be_head
551 @document.meta.should be_a_kind_of(VersionedDocument)
552 @document.meta.should_not have_slot(:some_slot)
553 end
554
555end
513556describe "Saved VersionedDocument" do
514557
515558 before(:each) do
toggle raw diff