示例#1
0
 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');
   });
 });
示例#2
0
 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`);
   });
 });
示例#3
0
 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');
   });
 });