Skip to content

Commit

Permalink
added broken test case (bind to specific attribute changes)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufsafak committed Apr 11, 2012
1 parent ab04222 commit 4081a9b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion observe/observe_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.