From f71004fc7ac99113a525f8453bacc5aa39a36fcd Mon Sep 17 00:00:00 2001 From: Casey Foster Date: Mon, 10 Dec 2012 21:28:12 -0800 Subject: [PATCH] Add failing test case for different `idAttribute` fields --- test/collection.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/collection.js b/test/collection.js index eb7f981a..133aa9a5 100644 --- a/test/collection.js +++ b/test/collection.js @@ -824,4 +824,13 @@ $(document).ready(function() { strictEqual(c.length, 0); }); + test("`update` with non-normal id", function() { + var Collection = Backbone.Collection.extend({ + model: Backbone.Model.extend({idAttribute: '_id'}) + }); + var collection = new Collection({_id: 1}); + collection.update([{_id: 1, a: 1}], {add: false}); + equal(collection.first().get('a'), 1); + }); + });