couchrest query params passed through by_xxxx views

This commit is contained in:
Chris Anderson 2008-09-29 17:46:33 -07:00
parent f408dfceb6
commit 4a1de8c1ba
2 changed files with 14 additions and 8 deletions

View file

@ -236,7 +236,13 @@ describe CouchRest::Model do
end
it "should sort correctly" do
articles = Article.by_user_id_and_date
# articles.should == 'x'
articles.collect{|a|a.doc['user_id']}.should == ['aaron', 'aaron', 'quentin', 'quentin']
articles[1].title.should == 'not junk'
end
it "should be queryable with couchrest options" do
articles = Article.by_user_id_and_date :count => 1, :startkey => 'quentin'
articles.length.should == 1
articles[0].title.should == "even more interesting"
end
end
end