]> source.dussan.org Git - jquery.git/commitdiff
Forgot to land Justin's tests for the event fixes.
authorJustin Meyer <justinbmeyer@gmail.com>
Thu, 4 Feb 2010 05:49:46 +0000 (00:49 -0500)
committerjeresig <jeresig@gmail.com>
Thu, 4 Feb 2010 05:49:46 +0000 (00:49 -0500)
test/unit/event.js

index ed9621317ad5965b8b8a7077da88f1f845d42a06..9ce6e2f6b42ad886d8155d6f1cb0846095db000f 100644 (file)
@@ -300,6 +300,24 @@ test("bind(), multi-namespaced events", function() {
        jQuery("#firstp").trigger("custom");
 });
 
+test("bind(), with same function", function() {
+       expect(2)
+
+       var count = 0 ,  func = function(){
+               count++;
+       };
+
+       jQuery("#liveHandlerOrder").bind("foo.bar", func).bind("foo.zar", func);
+       jQuery("#liveHandlerOrder").trigger("foo.bar");
+
+       equals(count, 1, "Verify binding function with multiple namespaces." );
+
+       jQuery("#liveHandlerOrder").unbind("foo.bar", func).unbind("foo.zar", func);
+       jQuery("#liveHandlerOrder").trigger("foo.bar");
+
+       equals(count, 1, "Verify that removing events still work." );
+});
 test("bind(), with different this object", function() {
        expect(4);
        var thisObject = { myThis: true },