Permalink
Browse files

added broken test case (bind to specific attribute changes)

  • Loading branch information...
yusufsafak committed Apr 11, 2012
1 parent ab04222 commit 4081a9baf4441c1002467342baae3cdd885994c6
Showing with 13 additions and 1 deletion.
  1. +13 −1 observe/observe_test.js
View
@@ -321,4 +321,16 @@ test("recursive observers do not cause stack overflow", function() {
console.log("adding")
a.attr("b", b);
});
});
test("bind to specific attribute changes", function() {
var paginate = new can.Observe( { offset: 100, limit: 100, count: 2000 } );
paginate.bind( 'offset', function( ev, newVal, oldVal ) {
equals(newVal, 200);
equals(oldVal, 100);
// newVal = 200
// oldVal = 100
});
paginate.attr( 'offset', 200 );
});

0 comments on commit 4081a9b

Please sign in to comment.