This commit is contained in:
Kevin Anthoney 2016-08-07 19:44:07 +01:00
Родитель 01bed74088
Коммит 9927675b9d
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -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');
});
});