Fix count specs
This commit is contained in:
Родитель
01bed74088
Коммит
9927675b9d
2
odata.js
2
odata.js
|
@ -194,7 +194,7 @@ Odata.prototype.query = function()
|
|||
return;
|
||||
};
|
||||
if(this._count) {
|
||||
q += '/$count';
|
||||
q += '/%24count';
|
||||
}
|
||||
if(this.config._format !== undefined && this._count === undefined) {
|
||||
addPart('$format', this.config._format);
|
||||
|
|
|
@ -15,12 +15,12 @@ describe('count tests', function() {
|
|||
});
|
||||
|
||||
it('should get a count of Customers', function() {
|
||||
expect(odata.count().query()).toEqual('https://example.com/Customers?%24count');
|
||||
expect(odata.count().query()).toEqual('https://example.com/Customers/%24count');
|
||||
});
|
||||
|
||||
it('should get a count of Customers with balance > 1000', function() {
|
||||
expect(odata.filter('balance', '>', 1000).count().query())
|
||||
.toEqual('https://example.com/Customers?%24count&%24filter=balance%20gt%201000');
|
||||
.toEqual('https://example.com/Customers/%24count?%24filter=balance%20gt%201000');
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче