diff options
author | James Lal <james@lightsofapollo.com> | 2012-07-06 14:52:13 -0700 |
---|---|---|
committer | James Lal <james@lightsofapollo.com> | 2012-07-06 14:52:13 -0700 |
commit | 684ec0e95608e3212d8dac1b2c7489cf7e5c3078 (patch) | |
tree | 15ff517b5715f4f32f44a70c2698caeb9426ee28 /test/caldav/request/abstract_test.js | |
parent | fa1bc078c2953c4d81d7c5c17e4f3a4c0e3febeb (diff) | |
download | jsCalDAV-684ec0e95608e3212d8dac1b2c7489cf7e5c3078.tar.gz |
Reworked requests to take connection object and options
Diffstat (limited to 'test/caldav/request/abstract_test.js')
-rw-r--r-- | test/caldav/request/abstract_test.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/test/caldav/request/abstract_test.js b/test/caldav/request/abstract_test.js index 6d74320..88d8b2b 100644 --- a/test/caldav/request/abstract_test.js +++ b/test/caldav/request/abstract_test.js @@ -4,11 +4,14 @@ suite('caldav/request/abstract.js', function() { var subject; var Abstract; var Xhr; + var Connection; + var con; var FakeXhr; var SAX; var oldXhrClass; var url = 'http://google.com/'; var options = { + url: url, configOpt: true }; @@ -17,6 +20,7 @@ suite('caldav/request/abstract.js', function() { FakeXhr = Caldav.require('support/fake_xhr'); Xhr = Caldav.require('xhr'); SAX = Caldav.require('sax'); + Connection = Caldav.require('connection'); oldXhrClass = Xhr.prototype.xhrClass; Xhr.prototype.xhrClass = FakeXhr; @@ -27,7 +31,11 @@ suite('caldav/request/abstract.js', function() { }); setup(function() { - subject = new Abstract(url, options); + con = new Connection({ + password: 'password', + user: 'user' + }); + subject = new Abstract(con, options); FakeXhr.instances.length = 0; }); @@ -39,14 +47,14 @@ suite('caldav/request/abstract.js', function() { assert.instanceOf(subject.xhr, Xhr); assert.equal(subject.xhr.url, url); assert.equal(subject.configOpt, options.configOpt); + assert.equal(subject.connection, con); assert.instanceOf(subject.sax, SAX); assert.equal(subject.xhr.headers['Content-Type'], 'text/xml'); }); test('xhr password options', function() { - var subject = new Abstract(url, { - password: 'password', - user: 'user' + var subject = new Abstract(con, { + url: url }); var xhr = subject.xhr; |