app-test.js revision f92e7fd6077d15d365b69901e9fa81bc9e5b495a
var ArrayAssert = Y.ArrayAssert,
ObjectAssert = Y.ObjectAssert,
// -- Global Suite -------------------------------------------------------------
// -- Model Suite --------------------------------------------------------------
// -- Model: Lifecycle ---------------------------------------------------------
name: 'Lifecycle',
'Models should have `changed` and `lastChange` properties': function () {
},
'destroy() should destroy the model instance': function () {
};
},
'destroy() should call a callback if provided as the only arg': function () {
method: 'callback',
args : []
});
},
'destroy() should call a callback if provided as the second arg': function () {
method: 'callback',
args : []
});
},
'destroy() should delete the model if the `delete` option is truthy': function () {
var calls = 0,
method: 'callback',
args : []
});
calls += 1;
callback();
};
}
}));
// -- Model: Attributes --------------------------------------------------------
name: 'Attributes',
setUp: function () {
idAttribute: 'customId'
}, {
ATTRS: {
}
});
},
tearDown: function () {
delete this.TestModel;
},
'Attributes should be settable at instantiation time': function () {
},
'Custom id attribute should be settable at instantiation time': function () {
var model;
// We need to set and get the id and customId attributes in various
// orders to ensure there are no issues due to the attributes being
// lazily added.
},
'id attribute should be an alias for the custom id attribute': function () {
var calls = 0,
// FIXME: Currently there's a bug where getting the 'id' attribute for
// the first time sets the 'customId' attribute to the 'id' attribute's
// default value and fires a change event. This shouldn't happen.
calls += 1;
});
},
'clientId attribute should be automatically generated': function () {
}
}));
// -- Model: Events ------------------------------------------------------------
name: 'Events',
setUp: function () {
ATTRS: {
}
});
},
tearDown: function () {
delete this.TestModel;
},
'`change` event should contain coalesced attribute changes': function () {
var calls = 0,
calls += 1;
});
foo: 'foo',
bar: 'bar'
}, {src: 'test'});
},
'`change` event should not fire when the _silent_ option is truthy': function () {
});
},
'`error` event should fire when validation fails': function () {
var calls = 0,
return 'ERROR. ERROR. DOES NOT COMPUTE.';
};
calls += 1;
});
},
'`error` event should fire when parsing fails': function () {
var calls = 0,
calls += 1;
});
}
}));
// -- Model: Methods -----------------------------------------------------------
name: 'Methods'
}));
}, '@VERSION@', {
});