Fixed regression tests

no issue

- https://travis-ci.org/TryGhost/Ghost/jobs/495022683
This commit is contained in:
kirrg001 2019-02-18 19:22:32 +01:00
parent 2ab0c8e222
commit a575f85af7
5 changed files with 16 additions and 41 deletions

View File

@ -111,19 +111,12 @@ describe('DB API', function () {
});
});
it('import should fail without file', function (done) {
request.post(localUtils.API.getApiQuery('db/'))
it('import should fail without file', function () {
return request.post(localUtils.API.getApiQuery('db/'))
.set('Authorization', 'Bearer ' + accesstoken)
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(403)
.end(function (err) {
if (err) {
return done(err);
}
done();
});
.expect(422);
});
it('import should fail with unsupported file', function (done) {

View File

@ -81,19 +81,13 @@ describe('Upload Icon API', function () {
});
describe('error cases for icons', function () {
it('import should fail without file', function (done) {
request.post(localUtils.API.getApiQuery('uploads/icon'))
it('import should fail without file', function () {
return request
.post(localUtils.API.getApiQuery('uploads/icon'))
.set('Authorization', 'Bearer ' + accesstoken)
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(403)
.end(function (err) {
if (err) {
return done(err);
}
done();
});
.expect(422);
});
it('import should fail with unsupported file', function (done) {

View File

@ -100,19 +100,13 @@ describe('Upload API', function () {
});
describe('error cases', function () {
it('import should fail without file', function (done) {
request.post(localUtils.API.getApiQuery('uploads'))
it('import should fail without file', function () {
return request
.post(localUtils.API.getApiQuery('uploads'))
.set('Authorization', 'Bearer ' + accesstoken)
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(403)
.end(function (err) {
if (err) {
return done(err);
}
done();
});
.expect(422);
});
it('import should fail with unsupported file', function (done) {

View File

@ -70,7 +70,7 @@ describe('DB API', () => {
.set('Origin', config.get('url'))
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(403);
.expect(422);
});
it('import should fail with unsupported file', () => {

View File

@ -28,19 +28,13 @@ describe('Upload API', function () {
});
});
it('Can\'t import fail without file', function (done) {
request.post(localUtils.API.getApiQuery('uploads'))
it('Can\'t import fail without file', function () {
return request
.post(localUtils.API.getApiQuery('uploads'))
.set('Origin', config.get('url'))
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(403)
.end(function (err) {
if (err) {
return done(err);
}
done();
});
.expect(422);
});
it('Can\'t import with unsupported file', function (done) {