mirror of https://gitee.com/bigwinds/arangodb
Foxx.Repository#count
This commit is contained in:
parent
ca41f74a63
commit
e83d05d3b2
|
@ -429,6 +429,10 @@ _.extend(Repository.prototype, {
|
|||
/// ```
|
||||
/// @endDocuBlock
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
count: function () {
|
||||
'use strict';
|
||||
return this.collection.count();
|
||||
}
|
||||
});
|
||||
|
||||
Repository.extend = backbone_helpers.extend;
|
||||
|
|
|
@ -68,6 +68,7 @@ describe('Repository Methods', function () {
|
|||
collection = createSpyObj('collection', [
|
||||
'all',
|
||||
'save',
|
||||
'count',
|
||||
'document',
|
||||
'byExample',
|
||||
'firstExample',
|
||||
|
@ -275,6 +276,10 @@ describe('Repository Methods', function () {
|
|||
});
|
||||
|
||||
describe('for counting entries', function () {
|
||||
it('should count all');
|
||||
it('should count all', function () {
|
||||
var count = createSpy('count');
|
||||
collection.count.and.returnValue(count);
|
||||
expect(instance.count()).toBe(count);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue