mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Added test coverage for not supported media type
refs https://github.com/TryGhost/Toolbox/issues/95 - Only supported media types should be accepted by `/media/` enpoint
This commit is contained in:
parent
d657432531
commit
7eb7e00634
1 changed files with 10 additions and 0 deletions
|
@ -67,4 +67,14 @@ describe('Media API', function () {
|
|||
|
||||
media.push(res.body.media[0].url.replace(config.get('url'), ''));
|
||||
});
|
||||
|
||||
it('Rejects non-media file type', async function () {
|
||||
const res = await request.post(localUtils.API.getApiQuery('media/upload'))
|
||||
.set('Origin', config.get('url'))
|
||||
.expect('Content-Type', /json/)
|
||||
.attach('file', path.join(__dirname, '/../../utils/fixtures/images/favicon_16x_single.ico'))
|
||||
.expect(415);
|
||||
|
||||
res.body.errors[0].message.should.match(/select a valid media file/gi);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue