fixed all the specs so we are back to green

This commit is contained in:
Matt Aimonetti 2009-05-26 18:27:49 -07:00
parent 2d52225a25
commit e48a6c8866
8 changed files with 36 additions and 18 deletions

View file

@ -142,8 +142,14 @@ module CouchRest
bulk_save
end
result = if doc['_id']
slug = escape_docid(doc['_id'])
CouchRest.put "#{@uri}/#{slug}", doc
slug = escape_docid(doc['_id'])
begin
CouchRest.put "#{@uri}/#{slug}", doc
rescue RestClient::ResourceNotFound
p "resource not found when saving even tho an id was passed"
slug = doc['_id'] = @server.next_uuid
CouchRest.put "#{@uri}/#{slug}", doc
end
else
begin
slug = doc['_id'] = @server.next_uuid