it('should fail', () => { return yarl.delete(`localhost:${port}/site`, { headers: JSON.parse(JSON.stringify(headers)), body: {}, json: true }).catch(e => { const data = JSON.parse(e.response.body); should(data.error).be.eql('Not Found'); }); });
it('should fail', () => { return yarl.delete(`localhost:${port}/site/1`, { headers: JSON.parse(JSON.stringify(headers)), body: {}, json: true }).catch(e => { const data = JSON.parse(e.response.body); should(data.error).be.eql(`Site with '1' id doesn't exist`); }); });
it('should be Ok', () => { return yarl.delete(`localhost:${port}/site/${siteId}1`, { headers: JSON.parse(JSON.stringify(headers)), body: {}, json: true }).then(res => { const data = res.body.data; should(data).be.eql('Ok'); }); });