summaryrefslogtreecommitdiff
path: root/test/api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/api.ts')
-rw-r--r--test/api.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/api.ts b/test/api.ts
index 570ab6833d..343112b4aa 100644
--- a/test/api.ts
+++ b/test/api.ts
@@ -474,6 +474,20 @@ describe('API', () => {
assert.strictEqual(res.body.name, 'Lenna.png');
}));
+ it('ファイルに名前を付けられる', async(async () => {
+ const alice = await signup({ username: 'alice' });
+
+ const res = await assert.request(server)
+ .post('/drive/files/create')
+ .field('i', alice.token)
+ .field('name', 'Belmond.png')
+ .attach('file', fs.readFileSync(__dirname + '/resources/Lenna.png'), 'Lenna.png');
+
+ expect(res).have.status(200);
+ expect(res.body).be.a('object');
+ expect(res.body).have.property('name').eql('Belmond.png');
+ }));
+
it('ファイル無しで怒られる', async(async () => {
const alice = await signup({ username: 'alice' });