Skip to content

Commit 4081a9b

Browse files
committed
added broken test case (bind to specific attribute changes)
1 parent ab04222 commit 4081a9b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

observe/observe_test.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -321,4 +321,16 @@ test("recursive observers do not cause stack overflow", function() {
321321
console.log("adding")
322322
a.attr("b", b);
323323

324-
});
324+
});
325+
326+
test("bind to specific attribute changes", function() {
327+
var paginate = new can.Observe( { offset: 100, limit: 100, count: 2000 } );
328+
paginate.bind( 'offset', function( ev, newVal, oldVal ) {
329+
equals(newVal, 200);
330+
equals(oldVal, 100);
331+
// newVal = 200
332+
// oldVal = 100
333+
});
334+
paginate.attr( 'offset', 200 );
335+
});
336+

0 commit comments

Comments
 (0)