diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-02-14 14:48:08 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-02-14 14:48:08 +0900 |
| commit | 3dbffbfc4f7301ea46d445a7044e46e8e771b5cd (patch) | |
| tree | 10d2e3cdeb1df40ba24566f33f7e959f43dfc6d2 | |
| parent | [API] Fix bug (diff) | |
| download | misskey-3dbffbfc4f7301ea46d445a7044e46e8e771b5cd.tar.gz misskey-3dbffbfc4f7301ea46d445a7044e46e8e771b5cd.tar.bz2 misskey-3dbffbfc4f7301ea46d445a7044e46e8e771b5cd.zip | |
[Test] Add some tests
| -rw-r--r-- | test/api.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/api.js b/test/api.js index 467568843e..ce75a4028c 100644 --- a/test/api.js +++ b/test/api.js @@ -423,6 +423,40 @@ describe('API', () => { done(); }); })); + + it('投票の選択肢が無くて怒られる', () => new Promise(async (done) => { + const me = await insertSakurako(); + request('/posts/create', { + poll: {} + }, me).then(res => { + res.should.have.status(400); + done(); + }); + })); + + it('投票の選択肢が無くて怒られる (空の配列)', () => new Promise(async (done) => { + const me = await insertSakurako(); + request('/posts/create', { + poll: { + choices: [] + } + }, me).then(res => { + res.should.have.status(400); + done(); + }); + })); + + it('投票の選択肢が1つで怒られる', () => new Promise(async (done) => { + const me = await insertSakurako(); + request('/posts/create', { + poll: { + choices: ['Strawberry Pasta'] + } + }, me).then(res => { + res.should.have.status(400); + done(); + }); + })); }); describe('posts/show', () => { |