fixed bulk_load/get_bulk and the specs

This commit is contained in:
Matt Aimonetti 2009-05-13 20:44:57 -07:00
parent 0c0b6ecff2
commit 92b77a9649
3 changed files with 5 additions and 2 deletions

View file

@ -48,6 +48,7 @@ module CouchRest
def get_bulk(ids) def get_bulk(ids)
documents(:keys => ids, :include_docs => true) documents(:keys => ids, :include_docs => true)
end end
alias :bulk_load :get_bulk
# POST a temporary view function to CouchDB for querying. This is not # POST a temporary view function to CouchDB for querying. This is not
# recommended, as you don't get any performance benefit from CouchDB's # recommended, as you don't get any performance benefit from CouchDB's

View file

@ -602,7 +602,7 @@ describe CouchRest::Database do
it "should have the bulk_load macro" do it "should have the bulk_load macro" do
rs = @db.bulk_load ["doc0", "doc7"] rs = @db.bulk_load ["doc0", "doc7"]
rs['rows'].length.should == 2 rs['rows'].length.should == 2
ds['rows'][0]['doc']['another'].should == "doc" rs['rows'][0]['doc']['another'].should == "doc"
end end
end end

View file

@ -1,3 +1,5 @@
# encoding: utf-8
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper') require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
require File.join(FIXTURE_PATH, 'more', 'card') require File.join(FIXTURE_PATH, 'more', 'card')
require File.join(FIXTURE_PATH, 'more', 'cat') require File.join(FIXTURE_PATH, 'more', 'cat')
@ -68,7 +70,7 @@ describe CouchRest::CastedModel do
describe "casted as an array of a different type" do describe "casted as an array of a different type" do
before(:each) do before(:each) do
@obj = DummyModel.new(:keywords => ['couch', 'sofa', 'relax', 'canape']) @obj = DummyModel.new(:keywords => ['couch', 'sofa', 'relax', 'canapé'])
end end
it "should cast the array propery" do it "should cast the array propery" do