Permalink
Browse files

Add listenTo yourself and cleaning with stopListening test

  • Loading branch information...
1 parent abccd98 commit baac55096fc3fd7552a622651bbb0741c22c080b @gsamokovarov gsamokovarov committed Dec 29, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/events.js
View
@@ -92,6 +92,14 @@ $(document).ready(function() {
e.trigger("foo");
});
+ test("listenTo yourself cleans yourself up with stopListening", 1, function(){
+ var e = _.extend({}, Backbone.Events);
+ e.listenTo(e, "foo", function(){ ok(true); });
+ e.trigger("foo");
+ e.stopListening();
+ e.trigger("foo");
+ });
+
test("trigger all for each event", 3, function() {
var a, b, obj = { counter: 0 };
_.extend(obj, Backbone.Events);

0 comments on commit baac550

Please sign in to comment.