Fix collection saving

This commit is contained in:
Dan Stillman 2015-04-26 02:44:29 -04:00
parent 694896273a
commit 99dfc72a18
2 changed files with 13 additions and 2 deletions

View File

@ -296,7 +296,6 @@ Zotero.Collection.prototype._saveData = Zotero.Promise.coroutine(function* (env)
'collectionID',
'collectionName',
'parentCollectionID',
'clientDateModified',
'libraryID',
'key',
'version',
@ -306,7 +305,6 @@ Zotero.Collection.prototype._saveData = Zotero.Promise.coroutine(function* (env)
collectionID ? { int: collectionID } : null,
{ string: this.name },
env.parent ? env.parent : null,
Zotero.DB.transactionDateTime,
this.libraryID,
key,
this.version ? this.version : 0,

View File

@ -0,0 +1,13 @@
describe("Zotero.Collection", function() {
describe("#save()", function () {
it("should save a new collection", function* () {
var name = "Test";
var collection = new Zotero.Collection;
collection.name = name;
var id = yield collection.save();
collection = yield Zotero.Collections.getAsync(id);
assert.equal(collection.name, name);
});
})
})