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
|
/// @endDocuBlock
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
count: function () {
|
||||||
|
'use strict';
|
||||||
|
return this.collection.count();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Repository.extend = backbone_helpers.extend;
|
Repository.extend = backbone_helpers.extend;
|
||||||
|
|
|
@ -68,6 +68,7 @@ describe('Repository Methods', function () {
|
||||||
collection = createSpyObj('collection', [
|
collection = createSpyObj('collection', [
|
||||||
'all',
|
'all',
|
||||||
'save',
|
'save',
|
||||||
|
'count',
|
||||||
'document',
|
'document',
|
||||||
'byExample',
|
'byExample',
|
||||||
'firstExample',
|
'firstExample',
|
||||||
|
@ -275,6 +276,10 @@ describe('Repository Methods', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('for counting entries', 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