parent
b9129e6973
commit
6a1b55568c
|
@ -397,7 +397,8 @@ describe('manipulation', function() {
|
|||
.catch(done);
|
||||
});
|
||||
|
||||
it('should save existing object', function(done) {
|
||||
bdd.itIf(connectorCapabilities.cloudantCompatible !== false,
|
||||
'should save existing object', function(done) {
|
||||
// Cloudant could not guarantee findOne always return the same item
|
||||
Person.findOne(function(err, p) {
|
||||
if (err) return done(err);
|
||||
|
@ -414,7 +415,8 @@ describe('manipulation', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should save existing object (promise variant)', function(done) {
|
||||
bdd.itIf(connectorCapabilities.cloudantCompatible !== false,
|
||||
'should save existing object (promise variant)', function(done) {
|
||||
// Cloudant could not guarantee findOne always return the same item
|
||||
Person.findOne()
|
||||
.then(function(p) {
|
||||
|
@ -577,7 +579,8 @@ describe('manipulation', function() {
|
|||
});
|
||||
});
|
||||
|
||||
it('should discard undefined values before strict validation',
|
||||
bdd.itIf(connectorCapabilities.cloudantCompatible !== false,
|
||||
'should discard undefined values before strict validation',
|
||||
function(done) {
|
||||
Person.definition.settings.strict = true;
|
||||
Person.findById(person.id, function(err, p) {
|
||||
|
@ -1000,7 +1003,10 @@ describe('manipulation', function() {
|
|||
});
|
||||
});
|
||||
|
||||
if (!getSchema().connector.replaceById) {
|
||||
var hasReplaceById = connectorCapabilities.cloudantCompatible !== false &&
|
||||
!!getSchema().connector.replaceById;
|
||||
|
||||
if (!hasReplaceById) {
|
||||
describe.skip('replaceById - not implemented', function() {});
|
||||
} else {
|
||||
describe('replaceOrCreate', function() {
|
||||
|
@ -1223,8 +1229,6 @@ describe('manipulation', function() {
|
|||
});
|
||||
}
|
||||
|
||||
var hasReplaceById = !!getSchema().connector.replaceById;
|
||||
|
||||
bdd.describeIf(hasReplaceById && connectorCapabilities.supportForceId !== false, 'replaceOrCreate ' +
|
||||
'when forceId is true', function() {
|
||||
var Post, unknownId;
|
||||
|
@ -1273,7 +1277,7 @@ describe('manipulation', function() {
|
|||
});
|
||||
});
|
||||
|
||||
if (!getSchema().connector.replaceById) {
|
||||
if (!hasReplaceById) {
|
||||
describe.skip('replaceAttributes/replaceById - not implemented', function() {});
|
||||
} else {
|
||||
describe('replaceAttributes', function() {
|
||||
|
@ -1470,7 +1474,6 @@ describe('manipulation', function() {
|
|||
});
|
||||
}
|
||||
|
||||
hasReplaceById = !!getSchema().connector.replaceById;
|
||||
bdd.describeIf(hasReplaceById, 'replaceById', function() {
|
||||
var Post;
|
||||
before(function(done) {
|
||||
|
@ -2202,8 +2205,8 @@ describe('manipulation', function() {
|
|||
});
|
||||
});
|
||||
|
||||
bdd.itIf(connectorCapabilities.updateWithoutId !== false, 'should update all instances when ' +
|
||||
'the where condition is not provided', function(done) {
|
||||
bdd.itIf(connectorCapabilities.updateWithoutId !== false,
|
||||
'should update all instances when the where condition is not provided', function(done) {
|
||||
filterHarry = connectorCapabilities.deleteWithOtherThanId === false ?
|
||||
{id: idHarry} : {name: 'Harry Hoe'};
|
||||
filterBrett = connectorCapabilities.deleteWithOtherThanId === false ?
|
||||
|
@ -2248,9 +2251,9 @@ describe('manipulation', function() {
|
|||
});
|
||||
|
||||
describe('upsertWithWhere', function() {
|
||||
var ds = getSchema();
|
||||
var Person;
|
||||
var ds, Person;
|
||||
before('prepare "Person" model', function(done) {
|
||||
ds = getSchema();
|
||||
Person = ds.define('Person', {
|
||||
id: {type: Number, id: true},
|
||||
name: {type: String},
|
||||
|
|
Loading…
Reference in New Issue