fixed specs when run under rake

This commit is contained in:
Chris Anderson 2008-10-11 09:55:21 -07:00
parent 7a92723260
commit adcaaaf59a

View file

@ -419,7 +419,8 @@ describe CouchRest::Model do
Course.new(:title => 'aaa').save Course.new(:title => 'aaa').save
Course.new(:title => 'bbb').save Course.new(:title => 'bbb').save
end end
it "should make the design doc" do it "should make the design doc upon first query" do
Course.by_title
doc = Course.design_doc doc = Course.design_doc
doc['views']['all']['map'].should include('Course') doc['views']['all']['map'].should include('Course')
end end
@ -496,7 +497,7 @@ describe CouchRest::Model do
newdocs["rows"].length.should == @design_docs["rows"].length newdocs["rows"].length.should == @design_docs["rows"].length
end end
it "should create a new design document on view access" do it "should create a new design document on view access" do
Article.view_by :created_at Article.view_by :updated_at
Article.by_created_at Article.by_created_at
newdocs = Article.database.documents :startkey => "_design/", :endkey => "_design/\u9999" newdocs = Article.database.documents :startkey => "_design/", :endkey => "_design/\u9999"
newdocs["rows"].length.should == @design_docs["rows"].length + 1 newdocs["rows"].length.should == @design_docs["rows"].length + 1