diff options
author | John Resig <jeresig@gmail.com> | 2010-02-11 01:42:51 -0500 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2010-02-11 01:42:51 -0500 |
commit | 021b809acecc4e94613375b3182c86722470fe9b (patch) | |
tree | 77b70e014be92b036401945d08cf35aeec3eeee1 /test | |
parent | 639f4931b0409a8eb83aaf89a03b6b52f674663e (diff) | |
download | jquery-021b809acecc4e94613375b3182c86722470fe9b.tar.gz jquery-021b809acecc4e94613375b3182c86722470fe9b.zip |
Make sure that the teardown is called after all the handlers of a type are removed. Fixes #6065.
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/event.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/unit/event.js b/test/unit/event.js index e85c4bd9d..33329c311 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -72,7 +72,7 @@ test("bind(), multiple events at once and namespaces", function() { }); test("bind(), namespace with special add", function() { - expect(18); + expect(19); var div = jQuery("<div/>").bind("test", function(e) { ok( true, "Test event fired." ); @@ -87,7 +87,9 @@ test("bind(), namespace with special add", function() { equals( e.target, div[0], "And that the target is correct." ); }, setup: function(){}, - teardown: function(){}, + teardown: function(){ + ok(true, "Teardown called."); + }, add: function( handleObj ) { var handler = handleObj.handler; handleObj.handler = function(e) { @@ -116,6 +118,8 @@ test("bind(), namespace with special add", function() { // Should trigger 2 div.trigger("test.b"); + + div.unbind("test"); }); test("bind(), no data", function() { |