[Pkg-javascript-commits] [backbone] 76/281: assert that change is only triggered once

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:01:58 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.9.0
in repository backbone.

commit 3f004196bd5602864bf1fb3f95eea2cd997733d9
Author: Brad Dunbar <dunbarb2 at gmail.com>
Date:   Wed Nov 9 14:05:58 2011 -0500

    assert that change is only triggered once
---
 test/model.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/model.js b/test/model.js
index 4963248..8b47d57 100644
--- a/test/model.js
+++ b/test/model.js
@@ -450,12 +450,14 @@ $(document).ready(function() {
   });
 
   test("Model: Multiple nested calls to set", function() {
-    var model = new Backbone.Model({});
+    var counter = 0, model = new Backbone.Model({});
     model.bind('change', function() {
+      counter++;
       model.set({b: 1});
       model.set({a: 1});
     })
     .set({a: 1});
+    equal(counter, 1, 'change is only triggered once');
   });
 
 });

-- 
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