Merge commit 'sethladd/master'
This commit is contained in:
commit
cdf998b185
7 changed files with 123 additions and 91 deletions
|
@ -288,7 +288,8 @@ describe CouchRest::CastedModel do
|
|||
before :each do
|
||||
reset_test_db!
|
||||
@cat = Cat.new(:name => 'Sockington')
|
||||
@cat.favorite_toy = CatToy.new(:name => 'Catnip Ball')
|
||||
@favorite_toy = CatToy.new(:name => 'Catnip Ball')
|
||||
@cat.favorite_toy = @favorite_toy
|
||||
@cat.toys << CatToy.new(:name => 'Fuzzy Stick')
|
||||
end
|
||||
|
||||
|
@ -298,6 +299,7 @@ describe CouchRest::CastedModel do
|
|||
end
|
||||
|
||||
it "should be true after assignment" do
|
||||
@cat.should be_new
|
||||
@cat.favorite_toy.should be_new
|
||||
@cat.toys.first.should be_new
|
||||
end
|
||||
|
@ -340,6 +342,7 @@ describe CouchRest::CastedModel do
|
|||
|
||||
it "should reference the top document for" do
|
||||
@course.base_doc.should === @course
|
||||
@professor.casted_by.should === @course
|
||||
@professor.base_doc.should === @course
|
||||
@cat.base_doc.should === @course
|
||||
@toy1.base_doc.should === @course
|
||||
|
@ -347,6 +350,7 @@ describe CouchRest::CastedModel do
|
|||
end
|
||||
|
||||
it "should call setter on top document" do
|
||||
@toy1.base_doc.should_not be_nil
|
||||
@toy1.base_doc.title = 'Tom Foolery'
|
||||
@course.title.should == 'Tom Foolery'
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue