aboutsummaryrefslogtreecommitdiffstats
path: root/test/webcals/request/calendar_query_test.js
diff options
context:
space:
mode:
authorJames Lal <james@lightsofapollo.com>2012-06-27 12:27:09 +0200
committerJames Lal <james@lightsofapollo.com>2012-06-27 12:27:09 +0200
commitd74007aca2c501ac2fe56f8c440f01f6f6ceaa1f (patch)
tree2daea94d4e4028d2e4b2cd5217faf18045153de6 /test/webcals/request/calendar_query_test.js
parent20420489ef9ded9b16852bc84b4b36d5bf363680 (diff)
downloadjsCalDAV-d74007aca2c501ac2fe56f8c440f01f6f6ceaa1f.tar.gz
integrate calendar data
Diffstat (limited to 'test/webcals/request/calendar_query_test.js')
-rw-r--r--test/webcals/request/calendar_query_test.js33
1 files changed, 17 insertions, 16 deletions
diff --git a/test/webcals/request/calendar_query_test.js b/test/webcals/request/calendar_query_test.js
index 803b09a..f960e15 100644
--- a/test/webcals/request/calendar_query_test.js
+++ b/test/webcals/request/calendar_query_test.js
@@ -3,8 +3,8 @@ requireLib('request/propfind');
requireLib('request/calendar_query');
suite('webcals/request/propfind', function() {
- var Abstract,
- Propfind,
+ var Propfind,
+ CalendarData,
FakeXhr,
CalendarQuery,
Xhr,
@@ -17,6 +17,7 @@ suite('webcals/request/propfind', function() {
suiteSetup(function() {
Propfind = Webcals.require('request/propfind');
+ CalendarData = Webcals.require('templates/calendar_data');
CalendarQuery = Webcals.require('request/calendar_query');
SaxResponse = Webcals.require('sax/dav_response');
FakeXhr = Webcals.require('support/fake_xhr');
@@ -41,31 +42,31 @@ suite('webcals/request/propfind', function() {
assert.deepEqual(subject._props, []);
assert.equal(subject.xhr.headers['Depth'], 1);
assert.equal(subject.xhr.method, 'REPORT');
- });
-
- test('#prop', function() {
- var expected = subject.template.tag('test');
- subject.prop('test');
-
- assert.deepEqual(subject._props, [expected]);
+ assert.instanceOf(subject.fields, CalendarData);
});
test('#_createPayload', function() {
- return;
- subject.prop('foo');
- subject.prop('bar');
+ subject.prop('getetag');
+ subject.fields.select('VEVENT', ['NAME']);
var tags = [
- '<N0:foo />',
- '<N0:bar />'
+ '<N0:getetag />',
+ '<N1:calendar-data>',
+ '<N1:comp name="VCALENDAR">',
+ '<N1:comp name="VEVENT">',
+ '<N1:prop name="NAME" />',
+ '</N1:comp>',
+ '</N1:comp>',
+ '</N1:calendar-data>'
].join('');
var expected = [
subject.template.doctype,
- '<N0:propfind xmlns:N0="DAV:">',
+ '<N0:calendar-query xmlns:N0="DAV:" ',
+ 'xmlns:N1="urn:ietf:params:xml:ns:caldav">',
'<N0:prop>', tags, '</N0:prop>',
- '</N0:propfind>'
+ '</N0:calendar-query>'
].join('');
assert.equal(subject._createPayload(), expected);