Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added failing test for nested object in uri.paramify

uri.paramify should handle nested objects too.
  • Loading branch information...
commit a40dbc4ae51884284a51ec445cac121958e4203d 1 parent 4367e5b
Ondrej authored April 12, 2014

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. 6  test/uri.js
6  test/uri.js
@@ -76,6 +76,12 @@ tests = {
76 76
     assert.equal(actual, data);
77 77
   }
78 78
 
  79
+, 'test paramify with a nested object': function() {
  80
+    var data = uri.paramify({name: {foo: 'bar', list: [2, 3, 4], obj: {a: 2, b: {c: 2}}}})
  81
+      , actual = 'name[foo]=bar&name[list][0]=2&name[list][1]=3&name[list][2]=4&name[obj][a]=2&name[obj][b][c]=2';
  82
+    assert.equal(actual, data);
  83
+  }
  84
+
79 85
 , 'test objectify for uri': function () {
80 86
     var expected = {name: 'user'}
81 87
       , actual = uri.objectify('name=user');

0 notes on commit a40dbc4

Please sign in to comment.
Something went wrong with that request. Please try again.