summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-22 12:43:15 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-22 12:43:15 +0900
commitf2c5dc468c9bdb86e096565e9306f53eb1876ce0 (patch)
tree375cc71cb5d538541f8c9db8b80a615556a4d233 /test
parentClean up :sparkles: (diff)
downloadmisskey-f2c5dc468c9bdb86e096565e9306f53eb1876ce0.tar.gz
misskey-f2c5dc468c9bdb86e096565e9306f53eb1876ce0.tar.bz2
misskey-f2c5dc468c9bdb86e096565e9306f53eb1876ce0.zip
Extract user's profile
Diffstat (limited to 'test')
-rw-r--r--test/api.js23
1 files changed, 16 insertions, 7 deletions
diff --git a/test/api.js b/test/api.js
index ce75a4028c..40dbdf201b 100644
--- a/test/api.js
+++ b/test/api.js
@@ -134,7 +134,11 @@ describe('API', () => {
describe('i/update', () => {
it('アカウント設定を更新できる', () => new Promise(async (done) => {
- const me = await insertSakurako();
+ const me = await insertSakurako({
+ profile: {
+ gender: 'female'
+ }
+ });
const myName = '大室櫻子';
const myLocation = '七森中';
@@ -148,8 +152,10 @@ describe('API', () => {
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);
+ res.body.should.have.property('profile').a('object');
+ res.body.should.have.deep.property('profile.location').eql(myLocation);
+ res.body.should.have.deep.property('profile.birthday').eql(myBirthday);
+ res.body.should.have.deep.property('profile.gender').eql('female');
done();
});
}));
@@ -159,11 +165,12 @@ describe('API', () => {
birthday: '2000-09-07'
});
request('/i/update', {
- birthday: ''
+ birthday: null
}, me).then(res => {
res.should.have.status(200);
res.body.should.be.a('object');
- res.body.should.have.property('birthday').eql(null);
+ res.body.should.have.property('profile').a('object');
+ res.body.should.have.deep.property('profile.birthday').eql(null);
done();
});
}));
@@ -1214,7 +1221,8 @@ async function insertSakurako(opts) {
token: '!00000000000000000000000000000000',
username: 'sakurako',
username_lower: 'sakurako',
- password: '$2a$08$FnHXg3tP.M/kINWgQSXNqeoBsiVrkj.ecXX8mW9rfBzMRkibYfjYy' // HimawariDaisuki06160907
+ password: '$2a$08$FnHXg3tP.M/kINWgQSXNqeoBsiVrkj.ecXX8mW9rfBzMRkibYfjYy', // HimawariDaisuki06160907
+ profile: {}
}, opts));
}
@@ -1223,7 +1231,8 @@ async function insertHimawari(opts) {
token: '!00000000000000000000000000000001',
username: 'himawari',
username_lower: 'himawari',
- password: '$2a$08$OPESxR2RE/ZijjGanNKk6ezSqGFitqsbZqTjWUZPLhORMKxHCbc4O' // ilovesakurako
+ password: '$2a$08$OPESxR2RE/ZijjGanNKk6ezSqGFitqsbZqTjWUZPLhORMKxHCbc4O', // ilovesakurako
+ profile: {}
}, opts));
}