Added in #690, the ability to remove an event handler from inside itself.
[jquery.git] / src / jquery / coreTest.js
index ada7195..67dea20 100644 (file)
@@ -564,3 +564,16 @@ test("removeClass(String) - add three classes and remove again", function() {
 test("removeAttr(String", function() {\r
        ok( $('#mark').removeAttr("class")[0].className == "", "remove class" );\r
 });\r
+\r
+test("unbind(event)", function() {\r
+       expect(3);\r
+       var el = $("#firstp");\r
+       el.click(function() {\r
+               ok( true, "Fake normal bind" );\r
+       });\r
+       el.click(function(event) {\r
+               el.unbind(event);\r
+               ok( true, "Fake onebind" );\r
+       });\r
+       el.click().click();\r
+});\r