mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-08 03:00:26 -04:00
check for duplicate models/ids
This commit is contained in:
@@ -527,4 +527,11 @@ $(document).ready(function() {
|
||||
equal(col.length, 0);
|
||||
});
|
||||
|
||||
test("Collection: multiple copies of the same model", function() {
|
||||
var col = new Backbone.Collection();
|
||||
var model = new Backbone.Model();
|
||||
raises(function() { col.add([model, model]) });
|
||||
raises(function() { col.add([{id: 1}, {id: 1}]); });
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user