aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/caldav/request/resources_test.js8
-rw-r--r--test/caldav/resources/calendar_test.js21
-rw-r--r--test/helper.js1
3 files changed, 28 insertions, 2 deletions
diff --git a/test/caldav/request/resources_test.js b/test/caldav/request/resources_test.js
index ecea34a..19bebba 100644
--- a/test/caldav/request/resources_test.js
+++ b/test/caldav/request/resources_test.js
@@ -92,10 +92,14 @@ suite('caldav/resource_finder', function() {
});
assert.ok(result.calendar['a']);
- assert.instanceOf(result.calendar['a'], Handler);
+
+ var cal = result.calendar['a'];
+
+ assert.instanceOf(cal, Handler);
assert.equal(Object.keys(result.calendar).length, 1);
- assert.equal(result.calendar['a'].args[1].name.value, '1');
+ assert.equal(cal.args[1].name.value, '1');
+ assert.equal(cal.url, 'a');
});
});
diff --git a/test/caldav/resources/calendar_test.js b/test/caldav/resources/calendar_test.js
index aa23918..d7689c0 100644
--- a/test/caldav/resources/calendar_test.js
+++ b/test/caldav/resources/calendar_test.js
@@ -1,3 +1,7 @@
+requireRequest();
+
+testSupport.lib('request/calendar_query');
+
testSupport.lib('resources/calendar'),
testSupport.lib('xhr');
testSupport.lib('connection');
@@ -6,6 +10,7 @@ suite('caldav/resources/calendar', function() {
var Calendar;
var Connection;
+ var CalendarQuery;
var con;
var url = 'foobar.com';
var subject;
@@ -13,6 +18,7 @@ suite('caldav/resources/calendar', function() {
suiteSetup(function() {
Calendar = Caldav.require('resources/calendar');
Connection = Caldav.require('connection');
+ CalendarQuery = Caldav.require('request/calendar_query');
});
setup(function() {
@@ -26,6 +32,7 @@ suite('caldav/resources/calendar', function() {
test('without calendar data', function() {
assert.equal(subject.url, url);
+ assert.equal(subject.connection, con);
});
test('with calendar data', function() {
@@ -42,6 +49,20 @@ suite('caldav/resources/calendar', function() {
});
+ suite('#createQuery', function() {
+
+ var result;
+
+ setup(function() {
+ result = subject.createQuery();
+ });
+
+ test('result', function() {
+ assert.instanceOf(result, CalendarQuery);
+ assert.equal(result.url, url);
+ });
+ });
+
suite('#updateFromServer', function() {
function status(value, status) {
diff --git a/test/helper.js b/test/helper.js
index 306a426..efb2487 100644
--- a/test/helper.js
+++ b/test/helper.js
@@ -178,6 +178,7 @@
testSupport.lib('templates/calendar_data');
testSupport.lib('templates/calendar_filter');
testSupport.helper('fake_xhr');
+ testSupport.lib('request/propfind');
//in the future we need a callback for browser support.
if (typeof(callback) !== 'undefined') {