Skip to content

Commit

Permalink
Tests: Correct logic of a broken assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
markelog committed Apr 15, 2014
1 parent 9d79b99 commit ebbbe96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/unit/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,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 );
Expand All @@ -384,6 +382,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("<tr><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr>");
td = table.find("td").eq(0);
td.attr( "rowspan", "2" );
Expand Down

0 comments on commit ebbbe96

Please sign in to comment.