UNPKG

1.4 kBJavaScriptView Raw
1/*
2 Simulation of responses from server when we
3 ask for deleting hooks when no hooks are present
4
5 nock will simulate a gitlab server running at
6 localhost:80, where Strider Tester, a user is
7 registered with the name "stridertester", and
8 has been registered with api token - zRtVsmeznn7ySatTrnrp
9 stridertester is an "owner" of a group named "testunion"
10 and has admin access to three projects -
11 testunion / unionproject1
12 Strider Tester / pubproject1
13 Strider Tester / privproject1
14 */
15var nock = require('nock');
16
17module.exports = function () {
18 //--------------------------------------------------------------------------------------
19 //Empty array as list of hooks in response
20 nock('http://localhost:80')
21 .get('/api/v3/projects/5/hooks')
22 .query({"private_token": "zRtVsmeznn7ySatTrnrp"})
23 .reply(200, [], {
24 server: 'nginx',
25 date: 'Fri, 21 Aug 2015 16:08:18 GMT',
26 'content-type': 'application/json',
27 'content-length': '2',
28 connection: 'close',
29 status: '200 OK',
30 link: '<http://localhost/api/v3/projects/5/hooks?page=1&per_page=0>; rel="first", <http://localhost/api/v3/projects/5/hooks?page=0&per_page=0>; rel="last"',
31 etag: '"d751713988987e9331980363e24189ce"',
32 'cache-control': 'max-age=0, private, must-revalidate',
33 'x-request-id': 'de64f599-b582-4bcb-b68d-552c2441028e',
34 'x-runtime': '0.019459'
35 });
36};