From 9cdaa75b8650e6077540915b9a78392c9c7b5d68 Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Tue, 18 Feb 2014 21:46:00 +0400 Subject: Tests: Correct logic of a broken assertion --- test/unit/attributes.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/unit/attributes.js b/test/unit/attributes.js index 2ab583caa..48d845f7a 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -378,8 +378,6 @@ test( "attr(String, Object)", function() { strictEqual( $elem.attr("nonexisting"), undefined, "attr(name, value) works correctly on comment and text nodes (bug #7500)." ); }); - // Register the property name to avoid generating a new global when testing window - Globals.register("nonexisting"); jQuery.each( [ window, document, obj, "#firstp" ], function( i, elem ) { var oldVal = elem.nonexisting, $elem = jQuery( elem ); @@ -388,6 +386,9 @@ test( "attr(String, Object)", function() { elem.nonexisting = oldVal; }); + // Register the property on the window for the previous assertion so it will be clean up + Globals.register( "nonexisting" ); + table = jQuery("#table").append("cellcellcellcellcell"); td = table.find("td").eq(0); td.attr( "rowspan", "2" ); -- cgit v1.2.3