versioncollectionSpec.js 837 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2015
  3. *
  4. * This file is licensed under the Affero General Public License version 3
  5. * or later.
  6. *
  7. * See the COPYING-README file.
  8. *
  9. */
  10. describe('OCA.Versions.VersionCollection', function() {
  11. var VersionCollection = OCA.Versions.VersionCollection;
  12. var collection, fileInfoModel;
  13. beforeEach(function() {
  14. fileInfoModel = new OCA.Files.FileInfoModel({
  15. path: '/subdir',
  16. name: 'some file.txt',
  17. id: 10,
  18. });
  19. collection = new VersionCollection();
  20. collection.setFileInfo(fileInfoModel);
  21. collection.setCurrentUser('user');
  22. });
  23. it('fetches the versions', function() {
  24. collection.fetch();
  25. expect(fakeServer.requests.length).toEqual(1);
  26. expect(fakeServer.requests[0].url).toEqual(
  27. OC.linkToRemoteBase('dav') + '/versions/user/versions/10'
  28. );
  29. fakeServer.requests[0].respond(200);
  30. });
  31. });