From 0185dc7cb8f8cd884dfa7f1925fa7b446155a2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=81=E6=B2=BB=E5=B9=B3?= Date: Sat, 5 Nov 2016 22:23:32 +0800 Subject: [PATCH] Add userAPI#updateAvatarURL tests --- specs/endToEnd/apis/user.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/specs/endToEnd/apis/user.js b/specs/endToEnd/apis/user.js index abfe127..b898c2e 100644 --- a/specs/endToEnd/apis/user.js +++ b/specs/endToEnd/apis/user.js @@ -160,6 +160,21 @@ describe('#userAPI', () => { }); }); + describe('#updateAvatarURL()', () => { + it('[auth user] should update user avatar', (done) => { + let newAvatarURL = 'http://imgur.com/gallery/A8eQsll'; + + userAPI(new ApiEngine(reqs.users[0])) + .updateAvatarURL({ + avatarURL: newAvatarURL, + }) + .then((json) => { + expect(json.user.avatarURL).to.equal(newAvatarURL); + done(); + }); + }); + }); + describe('#updatePassword()', () => { it('[auth user] should be able to change password', (done) => { let oldPassword = features.users.users[0].password;