summaryrefslogtreecommitdiff
path: root/test/etap/030-doc-from-json.t
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2009-07-17 22:40:49 +0000
committerAdam Kocoloski <kocolosk@apache.org>2009-07-17 22:40:49 +0000
commit57ab96ff2f67854429fef487c0e293e34663d4af (patch)
treeec5df6f9e64633137ebaefd364c5ae2bc4edbb34 /test/etap/030-doc-from-json.t
parent91bf33fdc69c2087707795b8822b0fa7617f8709 (diff)
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
Diffstat (limited to 'test/etap/030-doc-from-json.t')
-rwxr-xr-xtest/etap/030-doc-from-json.t21
1 files changed, 15 insertions, 6 deletions
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."
},