mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-08 03:00:26 -04:00
Merge branch 'master' of github.com:spmason/backbone
This commit is contained in:
@@ -170,6 +170,14 @@ $(document).ready(function() {
|
||||
equals(i, 2, 'Unset does not fire an event for missing attributes.');
|
||||
});
|
||||
|
||||
test("Model: unset and changedAttributes", function() {
|
||||
var model = new Backbone.Model({a: 1});
|
||||
model.unset('a', {silent: true});
|
||||
var changedAttributes = model.changedAttributes();
|
||||
ok('a' in changedAttributes, 'changedAttributes should contain unset properties');
|
||||
equals(changedAttributes.a, undefined);
|
||||
});
|
||||
|
||||
test("Model: using a non-default id attribute.", function() {
|
||||
var MongoModel = Backbone.Model.extend({idAttribute : '_id'});
|
||||
var model = new MongoModel({id: 'eye-dee', _id: 25, title: 'Model'});
|
||||
|
||||
Reference in New Issue
Block a user