mirror of https://gitee.com/bigwinds/arangodb
Foxx.Repository#updateByExample
This commit is contained in:
parent
94e2d0e9a4
commit
473566a4e2
|
@ -403,6 +403,10 @@ _.extend(Repository.prototype, {
|
||||||
/// ```
|
/// ```
|
||||||
/// @endDocuBlock
|
/// @endDocuBlock
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
updateByExample: function (example, updates) {
|
||||||
|
'use strict';
|
||||||
|
this.collection.updateByExample(example, updates);
|
||||||
|
},
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// --SUBSECTION-- Counting Entries
|
// --SUBSECTION-- Counting Entries
|
||||||
|
|
|
@ -73,6 +73,7 @@ describe('Repository Methods', function () {
|
||||||
'firstExample',
|
'firstExample',
|
||||||
'remove',
|
'remove',
|
||||||
'removeByExample',
|
'removeByExample',
|
||||||
|
'updateByExample',
|
||||||
'replace',
|
'replace',
|
||||||
'replaceByExample'
|
'replaceByExample'
|
||||||
]);
|
]);
|
||||||
|
@ -250,7 +251,17 @@ describe('Repository Methods', function () {
|
||||||
|
|
||||||
describe('for updating entries', function () {
|
describe('for updating entries', function () {
|
||||||
it('should update by id');
|
it('should update by id');
|
||||||
it('should update by example');
|
|
||||||
|
it('should update by example', function () {
|
||||||
|
var example = createSpy('example'),
|
||||||
|
updates = createSpy('updates'),
|
||||||
|
idAndRev = createSpy('idAndRev');
|
||||||
|
|
||||||
|
collection.updateByExample.and.returnValue(idAndRev);
|
||||||
|
instance.updateByExample(example, updates);
|
||||||
|
|
||||||
|
expect(collection.updateByExample.calls.argsFor(0)).toEqual([example, updates]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('for counting entries', function () {
|
describe('for counting entries', function () {
|
||||||
|
|
Loading…
Reference in New Issue