mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-24 00:39:32 +09:00
test
This commit is contained in:
parent
a3164054d9
commit
988de1dd18
27
test/api.js
27
test/api.js
@ -55,13 +55,26 @@ describe('API', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('signin', done => {
|
||||
describe('signin', () => {
|
||||
it('間違ったパスワードでサインインできない', done => {
|
||||
request('/signin', {
|
||||
username: account.username,
|
||||
password: account.password + '.'
|
||||
}).then(res => {
|
||||
res.should.have.status(400);
|
||||
res.text.should.be.equal('incorrect password');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('正しい情報で正しくサインインできる', done => {
|
||||
request('/signin', account).then(res => {
|
||||
res.should.have.status(204);
|
||||
me = res.header['set-cookie'][0].match(/i=(!\w+)/)[1];
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('i/update', () => {
|
||||
it('update my name', done => {
|
||||
@ -75,6 +88,18 @@ describe('API', () => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('update my location', done => {
|
||||
const myLocation = '七森中';
|
||||
request('/i/update', {
|
||||
location: myLocation
|
||||
}, me).then(res => {
|
||||
res.should.have.status(200);
|
||||
res.body.should.be.a('object');
|
||||
res.body.should.have.property('location').eql(myLocation);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('posts/create', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user