Skip to content

Commit

Permalink
Failing spec for listenToOnce
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesplease authored and akre54 committed Nov 3, 2014
1 parent 854a2a4 commit 71cecdc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@
equal(_.keys(a._listeningTo).length, 0);
});

test("listenToOnce cleans up references after the event has fired", 2, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenToOnce(b, 'all', function(){ ok(true); });
b.trigger('anything');
equal(_.keys(a._listeningTo).length, 0);
});

test("listenTo with empty callback doesn't throw an error", 1, function(){
var e = _.extend({}, Backbone.Events);
e.listenTo(e, "foo", null);
Expand Down

0 comments on commit 71cecdc

Please sign in to comment.