Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'new-views' of git@github.com:yrashk/strokedb into new-v…
…iews
- Loading branch information
Showing
4 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require File.dirname(__FILE__) + '/spec_helper' | ||
|
||
describe "Document" do | ||
|
||
before(:each) do | ||
setup_default_store | ||
Object.send!(:remove_const,'SomeMeta') if defined?(SomeMeta) | ||
SomeMeta = Meta.new | ||
@document = Document.new | ||
end | ||
|
||
it "should assign a uuid-named slot for metaslot" do | ||
@document[SomeMeta] = "some value" | ||
@document.slotnames.should include(SomeMeta.document.uuid) | ||
end | ||
|
||
it "should be able to read metaslot" do | ||
@document[SomeMeta] = "some value" | ||
@document[SomeMeta].should == "some value" | ||
end | ||
|
||
describe "with metaslot assigned, once saved and reloaded" do | ||
|
||
before(:each) do | ||
@document[SomeMeta] = "some value" | ||
@document.save! | ||
@document = @document.reload | ||
end | ||
|
||
it "should be able to read metaslot" do | ||
@document[SomeMeta].should == "some value" | ||
end | ||
|
||
end | ||
|
||
|
||
|
||
end |