Skip to content

Commit

Permalink
Adds a test for deeply nested json/markup as per request
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker authored and pksunkara committed Feb 23, 2012
1 parent 453b05f commit 1a8312d
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/api-test.js
Expand Up @@ -220,6 +220,13 @@ vows.describe('merge data into markup').addBatch({
return common.createTest('test-16');
}()
),

'(17) It should be able to iterate over deeply nested objects': (

function() {
return common.createTest('test-17');
}()
)
}

}).export(module);
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/test-17.html
@@ -0,0 +1 @@
<ul><li class="organizations"><h3 class="name"></h3><ul><li class="staff"><table><tr class="name"><td class="first"></td><td class="last"></td></tr></table></li></ul></li></ul>
48 changes: 48 additions & 0 deletions test/fixtures/test-17.json
@@ -0,0 +1,48 @@
{

"organizations" : [

{
"name": "DotOrg",

"staff": [
{
"name": {
"first": "Dot",
"last" : "Matrix"
}
},
{
"name": {
"first": "Serious",
"last" : "Business"
}
}
]

},

{
"name": "FooBar",

"staff": [
{
"name": {
"first": "Foo",
"last" : "Bar"
}
},
{
"name": {
"first": "Baz",
"last" : "Bitsom"
}
}
]

}


]

}
1 change: 1 addition & 0 deletions test/fixtures/test-17.out
@@ -0,0 +1 @@
<ul><li class="organizations"><h3 class="name">DotOrg</h3><ul><li class="staff"><table><tr class="name"><td class="first">Dot</td><td class="last">Matrix</td></tr></table></li><li class="staff"><table><tr class="name"><td class="first">Serious</td><td class="last">Business</td></tr></table></li></ul></li><li class="organizations"><h3 class="name">FooBar</h3><ul><li class="staff"><table><tr class="name"><td class="first">Foo</td><td class="last">Bar</td></tr></table></li><li class="staff"><table><tr class="name"><td class="first">Baz</td><td class="last">Bitsom</td></tr></table></li></ul></li></ul>

0 comments on commit 1a8312d

Please sign in to comment.