Ejemplo n.º 1
0
 it('can find the index of a model matching a functional test', function() {
   var testFunc = function(index, model) {
         return model.get('id') === 2;
       };
   testCollection = new Collection(colors);
   expect(testCollection.indexOf(testFunc)).toEqual(1);
   testCollection.remove(1);
   expect(testCollection.indexOf(testFunc)).toEqual(-1);
 });
Ejemplo n.º 2
0
 it('can find the index of a model matching an attribute hash', function() {
   testCollection = new Collection(colors);
   expect(testCollection.indexOf({id: 2, color: 'green'})).toEqual(1);
   expect(testCollection.indexOf({id: 500, color: 'green'})).toEqual(-1);
 });