volumes: throw error for unsupported update
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
const common = require('./common.js'),
|
||||
expect = require('expect.js'),
|
||||
safe = require('safetydance'),
|
||||
superagent = require('superagent');
|
||||
|
||||
describe('Volumes API', function () {
|
||||
@@ -67,17 +68,13 @@ describe('Volumes API', function () {
|
||||
expect(response.body.hostPath).to.be('/media/cloudron-test-music');
|
||||
});
|
||||
|
||||
it('can update volume', async function () {
|
||||
let response = await superagent.post(`${serverUrl}/api/v1/volumes/${volumeId}`)
|
||||
it('cannot update volume', async function () {
|
||||
let [error, response] = await safe(superagent.post(`${serverUrl}/api/v1/volumes/${volumeId}`)
|
||||
.query({ access_token: owner.token })
|
||||
.send({ mountOptions: { hostPath: '/media/cloudron-test-music-2' }});
|
||||
expect(response.statusCode).to.equal(204);
|
||||
.send({ mountOptions: { hostPath: '/media/cloudron-test-music-2' }})
|
||||
.ok(() => true));
|
||||
|
||||
response = await superagent.get(`${serverUrl}/api/v1/volumes/${volumeId}`)
|
||||
.query({ access_token: owner.token });
|
||||
expect(response.statusCode).to.equal(200);
|
||||
expect(response.body.id).to.be(volumeId);
|
||||
expect(response.body.hostPath).to.be('/media/cloudron-test-music-2');
|
||||
expect(response.statusCode).to.equal(400); // cannot update filesytem
|
||||
});
|
||||
|
||||
it('can delete volume', async function () {
|
||||
|
||||
Reference in New Issue
Block a user