aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2011-09-19 21:07:07 -0400
committertimmywil <timmywillisn@gmail.com>2011-09-19 21:07:07 -0400
commitca4133cc3fb4202d08de0d9e9d05e2442be63653 (patch)
tree319987a9731ec0896735215bc98fcd29ab740519 /test
parentf60213648cefa9b53289ad01a55ead22a15e6ee1 (diff)
downloadjquery-ca4133cc3fb4202d08de0d9e9d05e2442be63653.tar.gz
jquery-ca4133cc3fb4202d08de0d9e9d05e2442be63653.zip
Landing pull request 492. 1.7 Remove multiple attributes (Symmetry with removeClass) Combines patches submitted by leeoniya, zertosh and my own tests. Fixes #5479.
More Details: - https://github.com/jquery/jquery/pull/492 - http://bugs.jquery.com/ticket/5479
Diffstat (limited to 'test')
-rw-r--r--test/unit/attributes.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js
index 5945510de..da39933d3 100644
--- a/test/unit/attributes.js
+++ b/test/unit/attributes.js
@@ -532,6 +532,28 @@ test("prop(String, Object)", function() {
jQuery( document ).removeProp("nonexisting");
});
+test("removeAttr(Multi String)", function() {
+ expect(8);
+
+ var div = jQuery("<div id='a' alt='b' title='c' rel='d'></div>"),
+ tests = {
+ id: "a",
+ alt: "b",
+ title: "c",
+ rel: "d"
+ };
+
+ jQuery.each( tests, function( key, val ) {
+ equal( div.attr(key), val, "Attribute `" + key + "` exists, and has a value of `" + val + "`" );
+ });
+
+ div.removeAttr( "id alt title rel" );
+
+ jQuery.each( tests, function( key, val ) {
+ equal( div.attr(key), undefined, "Attribute `" + key + "` was removed" );
+ });
+});
+
test("prop('tabindex')", function() {
expect(8);