From a93899fd402cdb082792ca4fea52e4c8367eb73d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Vachon?= Date: Wed, 22 Apr 2015 15:30:18 -0400 Subject: [PATCH] Adagios backend tests --- app/components/live/adagios_test.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 app/components/live/adagios_test.js diff --git a/app/components/live/adagios_test.js b/app/components/live/adagios_test.js new file mode 100644 index 0000000..ec54e8f --- /dev/null +++ b/app/components/live/adagios_test.js @@ -0,0 +1,25 @@ +'use strict'; + +describe('In Adagios Live', function () { + var $httpBackend; + + beforeEach(module('adagios.live')); + + beforeEach(inject(function (_$httpBackend_) { + $httpBackend = _$httpBackend_; + })); + + describe('getObjects', function () { + + it('should send the proper GET request', inject(function (getObjects) { + var fields = ['host_name', 'host_state', 'description'], + filters = { contains: { host_name: ['srv', 'a'], plugin_output: ['SWAP'] }, + startswith: { host_name: ['srv'] } }, + apiName = 'services'; + + getObjects(fields, filters, apiName); + $httpBackend.expectGET('/rest/status/json/services/?fields=host_name,host_state,description&host_name__contains=srv&host_name__contains=a&plugin_output__contains=SWAP&host_name__startswith=srv').respond(''); + $httpBackend.flush(); + })); + }); +});