fix(backend/URLPreviewService): エラーでHTTP 422を出すように (#10339)
* fix(backend/URLPreviewService): エラーでHTTP 402を出すように * fix import
This commit is contained in:
parent
2e051c5871
commit
e542a030e4
2 changed files with 20 additions and 6 deletions
|
@ -841,4 +841,12 @@ describe('Endpoints', () => {
|
|||
assert.strictEqual(res.body[0].id, carolPost.id);
|
||||
});
|
||||
});
|
||||
|
||||
describe('URL preview', () => {
|
||||
test('Error from summaly becomes HTTP 422', async () => {
|
||||
const res = await simpleGet('/url?url=https://e:xample.com');
|
||||
assert.strictEqual(res.status, 422);
|
||||
assert.strictEqual(res.body.error.code, 'URL_PREVIEW_FAILED');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue