aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-10-09 16:27:59 -0400
committerJohn Resig <jeresig@gmail.com>2010-10-09 16:27:59 -0400
commit4a0759dc79fd0ad540d946c346a5afe9ce9db4ad (patch)
tree68f525af29255754ccee6fb3c131981a43883904 /test
parent9b655a176b0d045c3773357761acf2fa93cd9650 (diff)
parentb03416954d8033e641bd658fb18631699db6cc51 (diff)
downloadjquery-4a0759dc79fd0ad540d946c346a5afe9ce9db4ad.tar.gz
jquery-4a0759dc79fd0ad540d946c346a5afe9ce9db4ad.zip
Merge branch 'bug7123' of http://github.com/csnover/jquery into csnover-bug7123
Diffstat (limited to 'test')
-rw-r--r--test/unit/attributes.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js
index a483195a4..c6007aacc 100644
--- a/test/unit/attributes.js
+++ b/test/unit/attributes.js
@@ -409,7 +409,19 @@ test("val(String/Number)", function() {
test("val(Function)", function() {
testVal(functionReturningObj);
-})
+});
+
+test( "val(Array of Numbers) (Bug #7123)", function() {
+ expect(4);
+ jQuery('#form').append('<input type="checkbox" name="arrayTest" value="1" /><input type="checkbox" name="arrayTest" value="2" /><input type="checkbox" name="arrayTest" value="3" checked="checked" /><input type="checkbox" name="arrayTest" value="4" />');
+ var elements = jQuery('input[name=arrayTest]').val([ 1, 2 ]);
+ ok( elements[0].checked, "First element was checked" );
+ ok( elements[1].checked, "Second element was checked" );
+ ok( !elements[2].checked, "Third element was unchecked" );
+ ok( !elements[3].checked, "Fourth element remained unchecked" );
+
+ elements.remove();
+});
test("val(Function) with incoming value", function() {
expect(10);