Fix tests

This commit is contained in:
Nicolas Le Goff
2013-07-11 01:26:09 +02:00
parent eb063d188a
commit e3bf9fbb4e

View File

@@ -76,7 +76,7 @@ define([
beforeEach(function() { beforeEach(function() {
this.collection = new FieldCollection([ this.collection = new FieldCollection([
{"id": 1, "sbas-id": sbasId, "name": "Categorie", "tag": "XMP:Categorie"}, {"id": 1, "sbas-id": sbasId, "name": "Categorie", "tag": "XMP:Categorie"},
{"id": 2, "sbas-id": sbasId, "name": "Object", "tag": "XMP:Object"}, {"id": 2, "sbas-id": sbasId, "name": "Object", "tag": "XMP:Object"}
], { ], {
"sbas_id": sbasId "sbas_id": sbasId
}); });
@@ -96,7 +96,7 @@ define([
describe("Methods", function() { describe("Methods", function() {
it("should retrieve categorie item if searching terms begins with 'cat'", function() { it("should retrieve categorie item if searching terms begins with 'cat'", function() {
this.collection.search('Cat').length.should.equal(1); this.collection.search('Cat')._wrapped.length.should.equal(1);
}); });
it("should retrieve previous and next index for given model", function() { it("should retrieve previous and next index for given model", function() {
@@ -306,7 +306,7 @@ define([
it("should reorder collection on drop action", function() { it("should reorder collection on drop action", function() {
var ui = {item: {index: function() {return 2;}}}; var ui = {item: {index: function() {return 2;}}};
AdminFieldApp.fieldListView.itemViews[0].dropAction({},ui); AdminFieldApp.fieldListView.itemViews[0].dropAction({},ui);
assert.equal(AdminFieldApp.fieldListView.collection.last().get('sorter'), 2, 'model is updated'); assert.equal(AdminFieldApp.fieldListView.collection.last().get('sorter'), 3, 'model is updated');
}); });
}); });
}); });