Skip to content

Commit

Permalink
add another test case
Browse files Browse the repository at this point in the history
  • Loading branch information
layerssss committed Nov 27, 2014
1 parent df6c8d5 commit 95e6d74
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/integration/encode-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ describe("encode", function() {
assert.deepEqual($form.serializeObject(), {a: [ { b: ["c"] } ]});
});

it("checkbox inputs as nested arrays with a sibling don't break", function() {
var $form = $('<form><input type="checkbox" name="a[][b][]" value="c" checked><input name="a[][d]" value="e" checked></form>');
assert.deepEqual($form.serializeObject(), {a: [ { b: ["c"], d: 'e' } ]});
});

it("checkbox inputs as booleans if value is 'on'", function() {
var $form = $('<form><input type="checkbox" name="a" value="on" checked></form>');
assert.deepEqual($form.serializeObject(), {a: true});
Expand Down

0 comments on commit 95e6d74

Please sign in to comment.