public
Fork of halfbyte/couchobject
Description: Library to access couchdb in ruby
Homepage: http://couchobject.rubyforge.org
Clone URL: git://github.com/jnunemaker/couchobject.git
Search Repo:
fixed database store doc spec
jnunemaker (author)
Wed May 07 19:26:54 -0700 2008
commit  bbc27f6f205990f1035cb42633ec142404313d01
tree    47242adeca34f895b5e1448a7015f4587350a578
parent  e0b8c9e6805e73d4c849f311e429e7824bb25e55
...
140
141
142
 
 
 
143
144
145
 
146
147
148
...
140
141
142
143
144
145
146
147
 
148
149
150
151
0
@@ -140,9 +140,12 @@
0
   end
0
   
0
   it "should store a document" do
0
+ response = mock("Net::HTTP::Response")
0
+ response.stub!(:code).and_return(200)
0
+ response.stub!(:body).and_return("{\"foo\":\"bar\"}")
0
     db = CouchObject::Database.new(@uri, "foo")
0
     doc = CouchObject::Document.new({"foo" => "bar"})
0
- db.should_receive(:post).with("", JSON.unparse("foo" => "bar"))
0
+ db.should_receive(:post).with("", JSON.unparse("foo" => "bar")).and_return(CouchObject::Response.new(response))
0
     db.store(doc)
0
   end
0
   

Comments

    No one has commented yet.