From 1634e5e1ab44eed2881b301905ae7be4353a36d4 Mon Sep 17 00:00:00 2001 From: James Lal Date: Thu, 26 Jul 2012 10:24:59 -0700 Subject: emit DAV:/response on sax for each response --- test/caldav/sax/dav_response_test.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test') diff --git a/test/caldav/sax/dav_response_test.js b/test/caldav/sax/dav_response_test.js index 1dac79d..cb3d2b7 100644 --- a/test/caldav/sax/dav_response_test.js +++ b/test/caldav/sax/dav_response_test.js @@ -90,12 +90,38 @@ suite('caldav/sax/dav_response', function() { }; test('output', function(done) { + var response = []; + + subject.on('DAV:/response', function(url, data) { + response.push([url, data]); + }); + + subject.once('complete', function(data) { assert.deepEqual( data.multistatus, expected, "expected \n '" + JSON.stringify(data.multistatus) + "'\n to equal \n '" + JSON.stringify(expected) + '\n"' ); + + assert.deepEqual( + [ + '/calendar/user/', + expected['/calendar/user/'] + ], + response[0], + '/calendar/user/ response' + ); + + assert.deepEqual( + [ + '/calendar/other', + expected['/calendar/other'] + ], + response[1], + '/calendar/other/ response' + ); + done(); }); subject.write(xml).close(); -- cgit