UNPKG

1.1 kBJavaScriptView Raw
1/*
2 Here we simulate the response of the server when there
3 no deploy keys registered in the project.
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
15 */
16var nock = require('nock');
17
18module.exports = function () {
19
20 nock('http://localhost:80')
21 .get('/api/v3/projects/5/keys')
22 .query({"private_token": "zRtVsmeznn7ySatTrnrp"})
23 .reply(200, [], {
24 server: 'nginx',
25 date: 'Wed, 19 Aug 2015 07:44:07 GMT',
26 'content-type': 'application/json',
27 'content-length': '2',
28 connection: 'close',
29 status: '200 OK',
30 etag: '"d751713988987e9331980363e24189ce"',
31 'cache-control': 'max-age=0, private, must-revalidate',
32 'x-request-id': '6335ed65-d224-42e7-bf6d-948559539f88',
33 'x-runtime': '0.015344'
34 });
35};