added couchrest-type back in to model

This commit is contained in:
Chris Anderson 2008-11-22 14:29:03 -08:00
parent 555764bbe8
commit 8533520ef9
2 changed files with 10 additions and 5 deletions

View file

@ -412,6 +412,12 @@ describe CouchRest::Model do
view['rows'].length.should == 4
end
it "should not include non-Articles" do
Article.database.save({"date" => 1})
view = Article.by_date :raw => true
view['rows'].length.should == 4
end
it "should return the matching objects (with default argument :descending => true)" do
articles = Article.by_date
articles.collect{|a|a.title}.should == @titles.reverse