Add test for query params

pull/4159/head
Alex Dik 9 years ago
parent a61d695d7f
commit 8cdca7bfc3
  1. 10
      frontend/app/components/api/api-v3/hal-link/hal-link.service.test.ts

@ -27,7 +27,7 @@
//++
describe('HalLink service', () => {
var $httpBackend;
var $httpBackend:ng.IHttpBackendService;
var HalLink;
beforeEach(angular.mock.module('openproject.api'));
@ -117,6 +117,14 @@ describe('HalLink service', () => {
$httpBackend.flush();
});
it('should pass parameters as query params to the request', () => {
link.$fetch({
hello: 'world'
});
$httpBackend.expectGET('/api/link?hello=world').respond(200);
$httpBackend.flush();
});
it('should perform a POST request', () => {
link.method = 'post';

Loading…
Cancel
Save