From 2a6ac7e3efcc2ef69d3028f92224004272a5ca32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?syuilo=E2=AD=90=EF=B8=8F?= Date: Wed, 18 Jan 2017 02:38:04 +0900 Subject: [PATCH] Update api.js --- test/api.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/api.js b/test/api.js index 85f199265b..89f820ef0a 100644 --- a/test/api.js +++ b/test/api.js @@ -229,6 +229,24 @@ describe('API', () => { }); })); + it('過去にフォロー歴があった状態でフォローできる', () => new Promise(async (done) => { + const hima = await insertHimawari(); + const me = await insertSakurako(); + await db.get('followings').insert({ + followee_id: hima._id, + follower_id: me._id, + deleted_at: new Date() + }); + request('/followings/create', { + user_id: hima._id.toString() + }, me).then(res => { + res.should.have.status(200); + res.body.should.be.a('object'); + res.body.should.have.property('id').eql(hima._id.toString()); + done(); + }); + })); + it('既にフォローしている場合は怒る', () => new Promise(async (done) => { const hima = await insertHimawari(); const me = await insertSakurako();