[Persistence] Add empty specs

Add empty specs for CouchDB adapter. WTD-537.
This commit is contained in:
Victor Woeltjen 2014-12-02 17:26:16 -08:00
parent 4646896ac8
commit aef6f44cb5
4 changed files with 46 additions and 3 deletions

View File

@ -9,10 +9,14 @@ define(
var spaces = [ SPACE ], var spaces = [ SPACE ],
revs = {}; revs = {};
// Convert a subpath to a full path, suitable to pass
// to $http.
function url(subpath) { function url(subpath) {
return PATH + '/' + subpath; return PATH + '/' + subpath;
} }
// Issue a request using $http; get back the plain JS object
// from the expected JSON response
function request(subpath, method, value) { function request(subpath, method, value) {
return $http({ return $http({
method: method, method: method,
@ -25,7 +29,7 @@ define(
}); });
} }
// Shorthand methods for various get types // Shorthand methods for various HTTP methods
function get(subpath) { function get(subpath) {
return request(subpath, "GET"); return request(subpath, "GET");
} }
@ -76,11 +80,11 @@ define(
return get(key).then(getModel); return get(key).then(getModel);
}, },
updateObject: function (space, key, value) { updateObject: function (space, key, value) {
return put(key, new CouchDocument(key, value, true)) return put(key, new CouchDocument(key, value, revs[key]))
.then(checkResponse); .then(checkResponse);
}, },
deleteObject: function (space, key, value) { deleteObject: function (space, key, value) {
return put(key, new CouchDocument(key, value, true, true)) return put(key, new CouchDocument(key, value, revs[key], true))
.then(checkResponse); .then(checkResponse);
} }
}; };

View File

@ -0,0 +1,15 @@
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/**
* DomainObjectProviderSpec. Created by vwoeltje on 11/6/14.
*/
define(
["../src/CouchDocument"],
function (CouchDocument) {
"use strict";
describe("A couch document", function () {
});
}
);

View File

@ -0,0 +1,20 @@
/*global define,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
/**
* DomainObjectProviderSpec. Created by vwoeltje on 11/6/14.
*/
define(
["../src/CouchPersistenceProvider"],
function (CouchPersistenceProvider) {
"use strict";
describe("The couch persistence provider", function () {
var mockHttp,
mockQ,
testSpace = "testSpace",
testPath = "/test/db",
provider;
});
}
);

View File

@ -0,0 +1,4 @@
[
"CouchDocument",
"CouchPersistenceProvider"
]