public
Fork of chuyeow/activecouch
Description: ActiveCouch is a simple, convenient, Ruby-idiomatic wrapper for CouchDB
Homepage: http://github.com/arunthampi/activecouch
Clone URL: git://github.com/arunthampi/activecouch.git
Search Repo:
- Specs for testing error conditions in #delete
arunthampi (author)
Mon Jan 21 09:02:27 -0800 2008
commit  13c88960dbd79700254c5bdffa31bd0c60d62d27
tree    dec28ad6362c25a7b847a2ee7d38c1b692a1fb42
parent  1eb61667938e7f621fe4772f3b7d5964adcece67
...
24
25
26
 
 
 
 
 
 
 
 
 
 
 
27
28
...
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
0
@@ -24,4 +24,15 @@ describe "ActiveCouch::Base #create method" do
0
     response = Net::HTTP.get_response URI.parse("http://localhost:5984/people/_all_docs/")
0
     response.body.index('"total_rows":0').should_not == nil
0
   end
0
+
0
+ it "should raise an error if the revision for the object is not set" do
0
+ p = Person.new(:name => 'McLovin')
0
+ lambda { p.delete }.should raise_error(ActiveCouch::ActiveCouchError, "You must specify a revision for the document to be deleted")
0
+ end
0
+
0
+ it "should raise an error if the id for the object is not set, but the revision is set" do
0
+ p = Person.new(:name => 'McLovin')
0
+ p.rev = '123'
0
+ lambda { p.delete }.should raise_error(ActiveCouch::ActiveCouchError, "You must specify an ID for the document to be deleted")
0
+ end
0
 end
0
\ No newline at end of file

Comments

    No one has commented yet.