[Pkg-javascript-commits] [backbone] 116/173: Merge pull request #3929 from craigmichaelmartin/avoid-redefinitions
Jonas Smedegaard
dr at jones.dk
Wed Aug 31 07:44:10 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository backbone.
commit 82d8ec840c88ef5740b3ff6a8a0757a3c15da733
Merge: 6d37e06 e0a5cc7
Author: Adam Krebs <krebsadam at gmail.com>
Date: Tue Jan 19 13:56:36 2016 -0500
Merge pull request #3929 from craigmichaelmartin/avoid-redefinitions
eliminate shadowed variable declarations
.eslintrc | 1 +
backbone.js | 26 +--
test/collection.js | 574 ++++++++++++++++++++++++++---------------------------
test/model.js | 94 ++++-----
test/router.js | 76 +++----
test/sync.js | 2 +-
test/view.js | 214 ++++++++++----------
7 files changed, 494 insertions(+), 493 deletions(-)
diff --cc test/collection.js
index bf95581,2176f9e..95165d1
--- a/test/collection.js
+++ b/test/collection.js
@@@ -106,30 -106,10 +106,30 @@@
assert.equal(collection.get(1).id, 1);
});
+ QUnit.test('has', function(assert) {
+ assert.expect(15);
+ assert.ok(col.has(a));
+ assert.ok(col.has(b));
+ assert.ok(col.has(c));
+ assert.ok(col.has(d));
+ assert.ok(col.has(a.id));
+ assert.ok(col.has(b.id));
+ assert.ok(col.has(c.id));
+ assert.ok(col.has(d.id));
+ assert.ok(col.has(a.cid));
+ assert.ok(col.has(b.cid));
+ assert.ok(col.has(c.cid));
+ assert.ok(col.has(d.cid));
+ var outsider = new Backbone.Model({id: 4});
+ assert.notOk(col.has(outsider));
+ assert.notOk(col.has(outsider.id));
+ assert.notOk(col.has(outsider.cid));
+ });
+
QUnit.test('update index when id changes', function(assert) {
assert.expect(4);
- var col = new Backbone.Collection();
- col.add([
+ var collection = new Backbone.Collection();
+ collection.add([
{id: 0, name: 'one'},
{id: 1, name: 'two'}
]);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list