Commit eddcb757 authored by Tristan Cavelier's avatar Tristan Cavelier

searchableencryption tests live compatible

parent 791ec893
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
/*jslint indent: 2, maxlen: 80, nomen: true */ /*jslint indent: 2, maxlen: 80, nomen: true */
/*global module, test, stop, start, ok, deepEqual, RSVP, jIO, test_util, sjcl, /*global module, test, stop, start, ok, deepEqual, RSVP, jIO, test_util, sjcl,
define, Blob */ define, Blob, searchableencryptionstorage_spec */
(function (dependencies, module) { (function (dependencies, module) {
"use strict"; "use strict";
...@@ -17,12 +17,21 @@ ...@@ -17,12 +17,21 @@
}(["rsvp", "jio", "qunit"], function (RSVP, jIO) { }(["rsvp", "jio", "qunit"], function (RSVP, jIO) {
"use strict"; "use strict";
var spec; var spec, use_fake_server = true, jIOUtilAjaxWrapper;
spec = { if (typeof searchableencryptionstorage_spec === "object") {
"type": "searchableencryption", use_fake_server = false;
"url": "http://fakeserver", spec = {
"password": "coincoin" "type": "searchableencryption",
}; "url": searchableencryptionstorage_spec.url,
"password": searchableencryptionstorage_spec.password
};
} else {
spec = {
"type": "searchableencryption",
"url": "http://fakeserver",
"password": "coincoin"
};
}
function reverse(promise) { function reverse(promise) {
return new RSVP.Promise(function (resolve, reject, notify) { return new RSVP.Promise(function (resolve, reject, notify) {
...@@ -32,7 +41,7 @@ ...@@ -32,7 +41,7 @@
}); });
} }
jIO.util.ajax = (function () { jIOUtilAjaxWrapper = (function () {
/*jslint regexp: true */ /*jslint regexp: true */
// TEST SERVER // TEST SERVER
var dataBase, baseURLRe = /^http:\/\/fakeserver(\/[^\/]+)?(\/[^\/]+)?$/; var dataBase, baseURLRe = /^http:\/\/fakeserver(\/[^\/]+)?(\/[^\/]+)?$/;
...@@ -210,6 +219,10 @@ ...@@ -210,6 +219,10 @@
return ServerAjax; return ServerAjax;
}()); }());
if (use_fake_server) {
jIO.util.ajax = jIOUtilAjaxWrapper;
}
module("Searchable Encryption Storage"); module("Searchable Encryption Storage");
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment