.head('/upload/single') .attach('testFile', path.join(fileDir, mockFiles[0])) .expect(400)
this.Then(/^I should download the export file$/, function (callback) { request(app) .head('/v2/exports') .use(this.setAuthorizationHeader(this.uid)) .expect('Content-Type', 'application/zip') .expect(200, callback) })
this.Then(/^I should retrieve the document (\d+)(?:st|nd|rd|th) attachment$/, function (index, callback) { expect(this.myDocument).to.not.be.undefined expect(this.myDocument.attachments).to.not.be.undefined expect(this.myDocument.attachments).to.have.length.of.at.least(index) const attachment = this.myDocument.attachments[index - 1] request(app) .head('/v2/documents/' + this.myDocument.id + '/files/' + attachment.key) .use(this.setAuthorizationHeader(this.uid)) .expect('Content-Type', attachment.contentType) .expect(200, callback) })
describe('valid other method', function () { it('should 200', function (done) { var q = { timestamp: new Date().getTime(), nonce: parseInt((Math.random() * 10e10), 10) }; var s = ['some token', q.timestamp, q.nonce].sort().join(''); q.signature = require('crypto').createHash('sha1').update(s).digest('hex'); q.echostr = 'hehe'; request(app) .head('/wechat?' + querystring.stringify(q)) .expect(501, done); }); });
.head('/upload/single') .attach('testFile', path.join(fileDir, mockFiles[0])) .expect(400)
.head('/upload/single') .attach('testFile', path.join(fileDir, mockFiles[0])) .expect(400)
.head('/upload/single') .attach('testFile', path.join(fileDir, mockFiles[0])) .expect(400)