From 5e731c14d9fca4e99ac73f020d69008431ef4f81 Mon Sep 17 00:00:00 2001 From: James Lal Date: Wed, 27 Jun 2012 16:58:05 +0200 Subject: working calendar queries --- test/webcals/request/calendar_query_test.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'test/webcals/request/calendar_query_test.js') diff --git a/test/webcals/request/calendar_query_test.js b/test/webcals/request/calendar_query_test.js index f960e15..b1a167d 100644 --- a/test/webcals/request/calendar_query_test.js +++ b/test/webcals/request/calendar_query_test.js @@ -2,11 +2,12 @@ requireRequest(); requireLib('request/propfind'); requireLib('request/calendar_query'); -suite('webcals/request/propfind', function() { +suite('webcals/request/calendar_query', function() { var Propfind, - CalendarData, FakeXhr, + CalendarData, CalendarQuery, + CalendarFilter, Xhr, Template, oldXhrClass, @@ -18,6 +19,7 @@ suite('webcals/request/propfind', function() { suiteSetup(function() { Propfind = Webcals.require('request/propfind'); CalendarData = Webcals.require('templates/calendar_data'); + CalendarFilter = Webcals.require('templates/calendar_filter'); CalendarQuery = Webcals.require('request/calendar_query'); SaxResponse = Webcals.require('sax/dav_response'); FakeXhr = Webcals.require('support/fake_xhr'); @@ -44,13 +46,15 @@ suite('webcals/request/propfind', function() { assert.equal(subject.xhr.method, 'REPORT'); assert.instanceOf(subject.fields, CalendarData); + assert.instanceOf(subject.filters, CalendarFilter); }); test('#_createPayload', function() { subject.prop('getetag'); subject.fields.select('VEVENT', ['NAME']); + subject.filters.add('VEVENT', true); - var tags = [ + var props = [ '', '', '', @@ -61,12 +65,19 @@ suite('webcals/request/propfind', function() { '' ].join(''); + var filter = [ + '', + '', + '' + ].join(''); + var expected = [ subject.template.doctype, - '', - '', tags, '', - '' + '', props, '', + '', filter, '', + '' ].join(''); assert.equal(subject._createPayload(), expected); -- cgit