aboutsummaryrefslogtreecommitdiffstats
path: root/test/caldav
diff options
context:
space:
mode:
Diffstat (limited to 'test/caldav')
-rw-r--r--test/caldav/xhr_test.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/caldav/xhr_test.js b/test/caldav/xhr_test.js
index c442852..1082958 100644
--- a/test/caldav/xhr_test.js
+++ b/test/caldav/xhr_test.js
@@ -24,6 +24,29 @@ suite('webacls/xhr', function() {
assert.equal(subject.method, 'POST');
});
+ suite('with global args', function() {
+ var old;
+ var opts = { system: true };
+
+ setup(function() {
+ var old = Xhr.prototype.globalXhrOptions;
+ Xhr.prototype.globalXhrOptions = opts;
+ });
+
+ teardown(function() {
+ Xhr.prototype.globalXhrOptions = old;
+ });
+
+ test('constructed xhr', function() {
+ var subject = new Xhr({
+ method: 'POST',
+ xhrClass: FakeXhr
+ });
+ subject.send(function() {});
+ assert.ok(subject.xhr);
+ assert.equal(subject.xhr.constructorArgs[0], opts);
+ });
+ });
});
suite('.abort', function() {