Change computerProgram 'version' to 'versionNumber'
And use 'version' instead of 'itemVersion' for object version for items Also add deferred foreign key checking to system.sql so that DROP TABLE commands don't fail mid-transaction
This commit is contained in:
parent
5070c04af6
commit
43a2045aec
5 changed files with 34 additions and 15 deletions
|
@ -1,4 +1,4 @@
|
|||
describe("Zotero.Item", function() {
|
||||
describe("Zotero.Item", function () {
|
||||
describe("#getField()", function () {
|
||||
it("should return false for valid unset fields on unsaved items", function* () {
|
||||
var item = new Zotero.Item('book');
|
||||
|
@ -18,6 +18,24 @@ describe("Zotero.Item", function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe("#setField", function () {
|
||||
it("should save version as object version", function* () {
|
||||
var item = new Zotero.Item('book');
|
||||
item.setField("version", 1);
|
||||
var id = yield item.save();
|
||||
item = yield Zotero.Items.getAsync(id);
|
||||
assert.equal(item.getField("version"), 1);
|
||||
});
|
||||
|
||||
it("should save versionNumber for computerProgram", function () {
|
||||
var item = new Zotero.Item('computerProgram');
|
||||
item.setField("versionNumber", "1.0");
|
||||
var id = yield item.save();
|
||||
item = yield Zotero.Items.getAsync(id);
|
||||
assert.equal(item.getField("versionNumber"), "1.0");
|
||||
});
|
||||
})
|
||||
|
||||
describe("#parentID", function () {
|
||||
it("should create a child note", function () {
|
||||
return Zotero.DB.executeTransaction(function* () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue