server/apps/files_versions/tests/js/versioncollectionSpec.js
Robin Appelman ee84d83519
move versions webui over to the dav api
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-10-11 20:42:41 +02:00

34 lines
837 B
JavaScript

/*
* Copyright (c) 2015
*
* This file is licensed under the Affero General Public License version 3
* or later.
*
* See the COPYING-README file.
*
*/
describe('OCA.Versions.VersionCollection', function() {
var VersionCollection = OCA.Versions.VersionCollection;
var collection, fileInfoModel;
beforeEach(function() {
fileInfoModel = new OCA.Files.FileInfoModel({
path: '/subdir',
name: 'some file.txt',
id: 10,
});
collection = new VersionCollection();
collection.setFileInfo(fileInfoModel);
collection.setCurrentUser('user');
});
it('fetches the versions', function() {
collection.fetch();
expect(fakeServer.requests.length).toEqual(1);
expect(fakeServer.requests[0].url).toEqual(
OC.linkToRemoteBase('dav') + '/versions/user/versions/10'
);
fakeServer.requests[0].respond(200);
});
});