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