From 2596e82532c8d8400d158bad2866cf0b6e24cf13 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 20 Jan 2017 17:51:44 +0900 Subject: [PATCH] [Test] Add some tests --- test/api.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/api.js b/test/api.js index ee6098349e..c5e6476cfa 100644 --- a/test/api.js +++ b/test/api.js @@ -403,6 +403,24 @@ describe('API', () => { done(); }); })); + + it('空のパラメータで怒られる', () => new Promise(async (done) => { + const me = await insertSakurako(); + request('/posts/likes/create', {}, me).then(res => { + res.should.have.status(400); + done(); + }); + })); + + it('間違ったIDで怒られる', () => new Promise(async (done) => { + const me = await insertSakurako(); + request('/posts/likes/create', { + post_id: 'kyoppie' + }, me).then(res => { + res.should.have.status(400); + done(); + }); + })); }); describe('following/create', () => {