diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-01-19 15:40:43 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-01-19 15:40:43 +0900 |
| commit | 6d3542465de9fc73259c67f238691e03adff52bc (patch) | |
| tree | 41b9e964ba1ae622228cab09b22da4d7a6b534a6 /test/api.js | |
| parent | Update index.ts (diff) | |
| download | misskey-6d3542465de9fc73259c67f238691e03adff52bc.tar.gz misskey-6d3542465de9fc73259c67f238691e03adff52bc.tar.bz2 misskey-6d3542465de9fc73259c67f238691e03adff52bc.zip | |
test
Diffstat (limited to 'test/api.js')
| -rw-r--r-- | test/api.js | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/test/api.js b/test/api.js index 81903d2973..052f929437 100644 --- a/test/api.js +++ b/test/api.js @@ -124,26 +124,38 @@ describe('API', () => { })); }); - it('i/update', () => new Promise(async (done) => { - const me = await insertSakurako(); + describe('i/update', () => { + it('アカウント設定を更新できる', () => new Promise(async (done) => { + const me = await insertSakurako(); - const myName = '大室櫻子'; - const myLocation = '七森中'; - const myBirthday = '2000-09-07'; + const myName = '大室櫻子'; + const myLocation = '七森中'; + const myBirthday = '2000-09-07'; - request('/i/update', { - name: myName, - location: myLocation, - birthday: myBirthday - }, me).then(res => { - res.should.have.status(200); - res.body.should.be.a('object'); - res.body.should.have.property('name').eql(myName); - res.body.should.have.property('location').eql(myLocation); - res.body.should.have.property('birthday').eql(myBirthday); - done(); - }); - })); + request('/i/update', { + name: myName, + location: myLocation, + birthday: myBirthday + }, me).then(res => { + res.should.have.status(200); + res.body.should.be.a('object'); + res.body.should.have.property('name').eql(myName); + res.body.should.have.property('location').eql(myLocation); + res.body.should.have.property('birthday').eql(myBirthday); + done(); + }); + })); + + it('不正な誕生日の形式で怒られる', () => new Promise(async (done) => { + const me = await insertSakurako(); + request('/i/update', { + birthday: '2000/09/07' + }, me).then(res => { + res.should.have.status(400); + done(); + }); + })); + }); describe('users/show', () => { it('ユーザーが取得できる', () => new Promise(async (done) => { |