From 57ab96ff2f67854429fef487c0e293e34663d4af Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Fri, 17 Jul 2009 22:40:49 +0000 Subject: update etap tests for new attachment format. 031 #11 still fails because length is undefined in CouchDB's response. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@795258 13f79535-47bb-0310-9956-ffa450edef68 --- test/etap/030-doc-from-json.t | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'test/etap/030-doc-from-json.t') diff --git a/test/etap/030-doc-from-json.t b/test/etap/030-doc-from-json.t index 2bfdfdc5..241aee40 100755 --- a/test/etap/030-doc-from-json.t +++ b/test/etap/030-doc-from-json.t @@ -16,7 +16,8 @@ %% XXX: Figure out how to -include("couch_db.hrl") -record(doc, {id= <<"">>, revs={0, []}, body={[]}, - attachments=[], deleted=false, meta=[]}). + atts=[], deleted=false, meta=[]}). +-record(att, {name, type, len, md5= <<>>, revpos=0, data}). main(_) -> code:add_pathz("src/couchdb"), @@ -79,11 +80,19 @@ test_from_json_success() -> {<<"content_type">>, <<"application/pgp-signature">>} ]}} ]}}]}, - #doc{attachments=[ - {<<"my_attachment.fu">>, - {stub, <<"application/awesome">>, 45}}, - {<<"noahs_private_key.gpg">>, - {<<"application/pgp-signature">>, <<"I have a pet fish!">>}} + #doc{atts=[ + #att{ + name = <<"my_attachment.fu">>, + data = stub, + type = <<"application/awesome">>, + len = 45 + }, + #att{ + name = <<"noahs_private_key.gpg">>, + data = <<"I have a pet fish!">>, + type = <<"application/pgp-signature">>, + len = 18 + } ]}, "Attachments are parsed correctly." }, -- cgit v1.2.3