Skip to content

Commit

Permalink
Adding a test
Browse files Browse the repository at this point in the history
  • Loading branch information
geek committed Aug 14, 2014
1 parent 3cd85c4 commit dbfd805
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,24 @@ describe('#parse', function () {
expect(result).to.deep.equal(expected);
done();
});

it('parses an object and not child values', function (done) {

var input = {
"user[name]": {"pop[bob]": { "test": 3 }},
"user[email]": null
};

var expected = {
"user": {
"name": {"pop[bob]": { "test": 3 }},
"email": null
}
};

var result = Qs.parse(input);

expect(result).to.deep.equal(expected);
done();
});
});

0 comments on commit dbfd805

Please sign in to comment.